almightyegg Posted July 27, 2009 Share Posted July 27, 2009 I've used this exact code before yet it refuses to work. Here's my javascript: <body onLoad="document.form1.contact.focus()"> here's the form: <form action="send.php" method="POST" name="form1"> <table border="0"> <tr><td width="100"><b>To</b></td><td><input type="text" id="tokenize" name="contact" /></td></tr> <!--this is the form element I'm trying to focus on... but ti doesn't work. Perhaps it's because it has other javascript working on it too? though I didn't think that'd effect it--> <tr><td> </td><td></td></tr> <tr><td><b>Subject</b></td><td><input type="text" name="subject"></td></tr> <tr><td> </td><td></td></tr> <tr><td><b>Message</b></td><td></td></tr></table> <center> <input type=button value='Bold' onclick="aaatml(1);"><input type=button value='Italics' onclick="aaatml(2);"><input type=button value='Underline' onclick="aaatml(3);"><input type=button value='Strikethrough' onclick="aaatml(6);"><input type=button value='Link' onclick="aaatml(4);"><input type=button value='Image' onclick="aaatml(5);"> <br> <textarea id="colorBox" name="desc" style="width: 450px; height: 190px;"></textarea><br> </center> <input type="submit" value="Send"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/167618-problems-with-focusing-on-a-form-element/ Share on other sites More sharing options...
rhodesa Posted July 27, 2009 Share Posted July 27, 2009 code works fine for me Quote Link to comment https://forums.phpfreaks.com/topic/167618-problems-with-focusing-on-a-form-element/#findComment-883901 Share on other sites More sharing options...
almightyegg Posted July 27, 2009 Author Share Posted July 27, 2009 http://lordoftheabyss.com/comm/compose.php Try it :-/ I dunno what's wrong with it Quote Link to comment https://forums.phpfreaks.com/topic/167618-problems-with-focusing-on-a-form-element/#findComment-883907 Share on other sites More sharing options...
rhodesa Posted July 27, 2009 Share Posted July 27, 2009 You are using a jQuery plugin to modify the input and turn it into a fancy type-ahead dropdown. You need to look at the documentation for whatever plugin you are using, they should have some focus() method you can use with that. Quote Link to comment https://forums.phpfreaks.com/topic/167618-problems-with-focusing-on-a-form-element/#findComment-883932 Share on other sites More sharing options...
haku Posted July 27, 2009 Share Posted July 27, 2009 I've used this exact code before yet it refuses to work. It may help if you were even more vague about what the problem was. Next time, try not even posting text, just put up some code. Quote Link to comment https://forums.phpfreaks.com/topic/167618-problems-with-focusing-on-a-form-element/#findComment-883937 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.