Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling function on an event

Status
Not open for further replies.

greyone

Programmer
Dec 14, 2000
200
CA
i have a function which i want to call on focus of the input box. I could do that using the following

document.form.inputboxName.onFocus=functionname;

The problem is when i want to pass parameters in the function. Is there a way to pass parameters to the function
functionname as shown above.
 
hi nitinkhanna

you can do something like this

<input type=&quot;text&quot; name=&quot;inputboxName&quot; onfocus=&quot;Myfunction(parameter1, parameter2)&quot;>

hope this helps,
Chiu Chan
cchan@emagine-solutions.com
 
but i don't want to write the event in the input tag. Can i control the behaviour of events through javascript something like:

document.form.inputboxName.onFocus=functionname(parm1,parm2);

I know this dose'nt work but is there a workaround
 
thanks a lot but the only problem is that this dos'nt work in Netscape. So is there a workaround to make it work in Netscape
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top