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 Quote Link to comment 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> Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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".........?? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Dragen Posted May 24, 2007 Share Posted May 24, 2007 not if you're in a textarea Quote Link to comment 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? Quote Link to comment 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.