westman Posted April 18, 2012 Share Posted April 18, 2012 to post a form i have been using...<input name="formSubmit" type="submit" value="Send" />as normel and it works good but can i submit a form from a link...<a href="#">submit</a> is this posible? if so how? Link to comment Share on other sites More sharing options...
eTianbun Posted April 19, 2012 Share Posted April 19, 2012 YES, with javascript.EXAMPLE:NORMAL HTML FORM <form id='sub' action='reg.php' method='post'><input type='text' id='email'/></form> LINK TO CLICK <a href="javascript:document.getElementById('sub').submit()">Submit</a> Note that when javascript is disabled in the browser, you® form will not submit! Link to comment Share on other sites More sharing options...
westman Posted April 19, 2012 Author Share Posted April 19, 2012 thank you this works well but if you have "required" in the form like.. <input type="text" name="name1" id="name1" size="30" maxlength="50" required /> it dose not work. is they a way around it? Link to comment Share on other sites More sharing options...
eTianbun Posted April 19, 2012 Share Posted April 19, 2012 HTML5 attribute right?Well, i think you should remove it then, since it is a new attribute, because browsers like safari/IE do not support it, so you still have to validate it with script(s). Link to comment Share on other sites More sharing options...
westman Posted April 19, 2012 Author Share Posted April 19, 2012 ok thank you for your help very helpfill Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.