Jump to content
Sign in to follow this  
westman

form

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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!

Edited by eTianbun

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...