Joshua F Posted September 26, 2010 Share Posted September 26, 2010 I have a Go to Page form, but it's not working. I want it so when you press Go it will add ?page=# and # meaning the number you type in the Text Box before pressing go. Here's my code <form name='page'><input type='text' class='input_text' id='#{id}_input' size='8' name='page' value='' /> <input type='submit' value='Go' name='submit' class='input_submit add_folder' id='#{id}_submit' onClick='location=document.c693.c335.options[document.c693.c335.selectedIndex].value'/></form> Quote Link to comment https://forums.phpfreaks.com/topic/214406-go-to-page/ Share on other sites More sharing options...
jcbones Posted September 26, 2010 Share Posted September 26, 2010 <form name='form' action='' method='get'><input type='text' class='input_text' id='#{id}_input' size='8' name='page' value='' /> <input type='submit' value='Go' name='submit' class='input_submit add_folder' id='#{id}_submit'/></form> Quote Link to comment https://forums.phpfreaks.com/topic/214406-go-to-page/#findComment-1115764 Share on other sites More sharing options...
Joshua F Posted September 26, 2010 Author Share Posted September 26, 2010 Still not working. But maybe that's because it's in Javascript as a drop down. <script type='text/javascript'> //<![CDATA[ /* Templates/Language */ ipb.templates['page_jump'] = new Template("<div id='#{id}_wrap' class='ipbmenu_content'><h3 class='bar'>Jump to page</h3><form name='form' action='?page=' method='get'><input type='text' class='input_text' id='#{id}_input' size='8' name='page' value='' /> <input type='submit' value='Go' name='submit' class='input_submit add_folder' id='#{id}_submit'/></form></div>"); //]]> </script> Any ideas? Edit: Oops, wrong board. Quote Link to comment https://forums.phpfreaks.com/topic/214406-go-to-page/#findComment-1115767 Share on other sites More sharing options...
jcbones Posted September 26, 2010 Share Posted September 26, 2010 Well, javascript would make it not work that way. That is the plain HTML way of doing it. I would try it using the onSubmit event handler (or onBlur), and getting the value of the input field correctly. You are trying to get the input value by searching the options of a dropdown box. Or just post it in the javascript section, they may be more helpful. Quote Link to comment https://forums.phpfreaks.com/topic/214406-go-to-page/#findComment-1115772 Share on other sites More sharing options...
Joshua F Posted September 26, 2010 Author Share Posted September 26, 2010 Alright, I'll post it in the JavaScript section. Thanks for trying though. Quote Link to comment https://forums.phpfreaks.com/topic/214406-go-to-page/#findComment-1115774 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.