Guest eirche.net Posted October 18, 2005 Share Posted October 18, 2005 <form><input type="text" name="user" onchange="alert('message');"></form> the above code works as expected.i like to make something like this. but it doesn't work. <form><input type="text" name="user"></form><script type="text/javascript" >document.forms[0].user.onchange="alert('message');";</script> http://msdn.microsoft.com/workshop/author/...ts/onchange.asphttp://www.w3schools.com/htmldom/dom_obj_text.asp Link to comment Share on other sites More sharing options...
Chocolate570 Posted October 18, 2005 Share Posted October 18, 2005 Well, i don't think document.forms[0].event works. What i suggest: <html><head><script type="text/javascript">function ya(){alert("OMG! MESSAGE HERE! OMG!")}</script></head><body><form><input type="text" value="blah" onchange="ya()"></form></body></html> That is multi browser, and will work perfectly. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now