...

View Full Version : object name trouble



scroots
10-18-2003, 10:50 PM
if i have

function newevent(val){
alert(val);
}

<input type="button" value="Add a new event here" Onclick="newevent(abcd);">

how can i get it to alert "abcd" instead of "[object]". I understand i am passing it as an object and i need to pass it this way as i use the object bit for something else. so how can i do it without replacing Onclick="newevent(abcd);" with Onclick="newevent('abcd');"


scroots

fredmv
10-18-2003, 11:42 PM
Sorry, but I don't really understand what you're asking. :confused:

scriptkeeper
10-19-2003, 01:32 AM
U need quotes try this

function newevent(val){
alert(val);
}

<input type="button" value="Add a new event here" Onclick="newevent('abcd');">

Kor
10-19-2003, 09:47 AM
Always quote parameters if string...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum