instead of using document.smilie.whatever, use the W3C standard of using "getElementByID" or "getElementByName" as needed.
more info: http://www.w3schools.com/htmldom/dom_obj_document.asp
And in this case...
HTML Code:
<input type="button" name="datum" onclick="addDate('date','smilieform','name')" value="Datum" class="button" />
if u do "getElementByID", then u'll need to change that code above to:
HTML Code:
<input type="button" [B]id[/B]="datum" onclick="addDate('date',[B]'datum'[/B],'name')" value="Datum" class="button" />
(with this method, you don't even need the third parameter for the function).
O...one thing I noticed, you have nameField misspelled as "NaamField".
here's my modification for the getElementByID version (keep in mind that I didn't test it at all yet...
):
Code:
function addDate(date, formElementID) {
var day = new Date();
// following all on one line
//Months is zero-based (Jan=0, Feb=1, Mar=2, Apr=3, Mei=4, Jun=5, Jul=6, Aug=7, Sep=8, Okt=9, Nov=10, Dec=11) So must be incremented
var submitted = (+day.getHours()+':'+day.getMinutes());
var revisedNaam;
var formElement = getElementByID(formElementID);
var currentNaam = formElement.value;
revisedNaam = currentNaam+day;
formElement.value=revisedNaam;
formElement.focus();
return true;
}
Bookmarks