madhukar_garg Posted May 24, 2007 Share Posted May 24, 2007 Dear All, I am a new member in this group, can any one help me how i can submit a form without using a submit button, i have to use this in one of my ongoing project..... Thanks in advance....................... Madhukar Garg Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/ Share on other sites More sharing options...
taith Posted May 24, 2007 Share Posted May 24, 2007 <a href="javascript:void(0);" onclick="javascript:document.formname.submit();">submit</a> Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260627 Share on other sites More sharing options...
madhukar_garg Posted May 24, 2007 Author Share Posted May 24, 2007 pls tell me where to add this code??? whether in form tag or elsewhere Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260638 Share on other sites More sharing options...
chigley Posted May 24, 2007 Share Posted May 24, 2007 What do you want to use in place of the submit button? Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260640 Share on other sites More sharing options...
madhukar_garg Posted May 24, 2007 Author Share Posted May 24, 2007 nothing.......... if it is possible "by hitting enter key form will post".........?? Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260641 Share on other sites More sharing options...
Dragen Posted May 24, 2007 Share Posted May 24, 2007 place it somewhere in the form. It's just a simple link with a javascript action to it. to change what you're using as the replacement to the button, just change what is between the <a></a> change the 'formname' part in the onclick to whatever your form is called. onclick="javascript:document.formname.submit();" if you haven't named it, just put the name tag in the form part.. i.e: <form name="myform" method="post" action="sendform.php"> EDIT: just caught your last post.. you can do it using javascript, but I'm not sure on the code.. sorry. try posting in the javascript section Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260642 Share on other sites More sharing options...
chigley Posted May 24, 2007 Share Posted May 24, 2007 Don't bother with anything then, you can just hit enter from within a form field and it will submit. Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260643 Share on other sites More sharing options...
Dragen Posted May 24, 2007 Share Posted May 24, 2007 not if you're in a textarea Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260644 Share on other sites More sharing options...
ToonMariner Posted May 24, 2007 Share Posted May 24, 2007 you should NOT remove a submit button in favour of a javascript link to submit a form... ok have a submit button insside a <noscript> tag if you must but at the very least have one in there.. Why do you need to NOt have a submit button? Link to comment https://forums.phpfreaks.com/topic/52793-how-to-submit-a-form-without-a-submit-button/#findComment-260648 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.