Mod-Jay Posted May 7, 2011 Share Posted May 7, 2011 Is it posible to put a submit button somewhere out of a form and still use that submit button with the form? Link to comment https://forums.phpfreaks.com/topic/235773-question/ Share on other sites More sharing options...
PaulRyan Posted May 7, 2011 Share Posted May 7, 2011 Yeah, using some JavaScript and giving the form a name for example: <form name="myform" action="handle-data.php" method="POST"> Search: <input type='text' name='query' /> </form> <input type="button" onClick="document.myform.submit();" value="Search"> Regards, PaulRyan. Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211938 Share on other sites More sharing options...
Mod-Jay Posted May 7, 2011 Author Share Posted May 7, 2011 Thanks also, i have a search for online webpages, it searched everything on a page instantly and shows up like you would do ctrl+f, is there a way i can make the screen move with the highlighted words? Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211943 Share on other sites More sharing options...
PaulRyan Posted May 7, 2011 Share Posted May 7, 2011 Quite possibly, but I'm not 100% sure on that, have a search on Google for it, you may find it there buddy. Regards, PaulRyan. Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211944 Share on other sites More sharing options...
Mod-Jay Posted May 7, 2011 Author Share Posted May 7, 2011 Curious how would i put a text box outside of a form and still use it? Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211945 Share on other sites More sharing options...
PaulRyan Posted May 7, 2011 Share Posted May 7, 2011 I'm curious as to why you'd want to do that? But yeah, I'm sure you do something like that, maybes have a hidden field in the form and when you click submit, call a Javascript function to populate the hidden field with the value of the text box. Regards, PaulRyan. Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211947 Share on other sites More sharing options...
Mod-Jay Posted May 7, 2011 Author Share Posted May 7, 2011 im designing something that uses 5 different forms, the text box is in the form and is using a line break when it ends, so if i removed the form and put it somewhere else all id have to do it work the the inputs and make the design alot better. Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211949 Share on other sites More sharing options...
Mod-Jay Posted May 7, 2011 Author Share Posted May 7, 2011 One my question. it is posible that i can call a javascript function to call a php function and allow it to execute without reloading the page? Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211970 Share on other sites More sharing options...
KevinM1 Posted May 7, 2011 Share Posted May 7, 2011 One my question. it is posible that i can call a javascript function to call a php function and allow it to execute without reloading the page? Yes. That's what Ajax is. Link to comment https://forums.phpfreaks.com/topic/235773-question/#findComment-1211994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.