...

View Full Version : Form Actions



mr_ego
10-15-2003, 04:40 PM
When a button is clicked; an event occurs.


but this event can change.
i dont want the event to be assigned to the button
and i dont want a function to choose what even to happen

i would like javascript to manage the events.

document.userdefform.elements["item"].onClick = "selectit(this)";

this doesnt work..
but it's the theroy i'm describing.


any ideas?

mr_ego
10-16-2003, 10:48 AM
anyone?

glenngv
10-16-2003, 11:11 AM
try:
document.userdefform.elements["item"].onclick = function(){selectit(this)};

Kor
10-16-2003, 12:36 PM
or try:

document.userdefform.elements["item"].onClick = selectit(this);

glenngv
10-16-2003, 12:45 PM
watch the case, it should be onclick and using your solution will call the function immediately when that line is executed. What you want to do is assign the handler not execute it immediately.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum