meomike2000 Posted March 10, 2009 Share Posted March 10, 2009 is there a way so that when i click on the relpy button from the message and the form loads for the cursor to be in the message box ready to type...... thanks mike.... Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/ Share on other sites More sharing options...
lonewolf217 Posted March 10, 2009 Share Posted March 10, 2009 this is done with javascript. look up the setFocus() function <script type="text/javascript"> function setFocus(){ document.getElementById("messageBox").focus(); } </script> Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/#findComment-781412 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 thanks lonewolf you have been a great help.... mike.... Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/#findComment-781413 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 i have added this echo '<script type="text/javascript"> function setFocus() { document.getElementById("message").focus(); } </script>'; and i added the id="message" to the textarea input.... but no luck on the focus... what am i still missing here....... thanks mike.... Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/#findComment-781423 Share on other sites More sharing options...
lonewolf217 Posted March 10, 2009 Share Posted March 10, 2009 you need to find a way to run the function. the easiest way would be <body onload=setFocus()> but this would set the focus to the message box every time the page loads. otherwise you will have to find another way Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/#findComment-781430 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 ok i think i get it, i know very little about js. Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/#findComment-781467 Share on other sites More sharing options...
meomike2000 Posted March 10, 2009 Author Share Posted March 10, 2009 ok that worked thanks,,, now the cursor is at the bottom,,, going to try to get it to be at the top of the message box now,,, thanks for all the help..... Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/#findComment-781478 Share on other sites More sharing options...
haku Posted March 11, 2009 Share Posted March 11, 2009 To do that you have to write your textarea like this: <textarea></textarea> If you leave any whitespace in between these tags, it turns into whitespace inside the textarea when it renders. Quote Link to comment https://forums.phpfreaks.com/topic/148806-solved-one-more-question-about-reply-form/#findComment-781823 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.