Stop an input field in a form from being submitted

Posted by Acorn on Stack Overflow See other posts from Stack Overflow or by Acorn
Published on 2010-06-09T16:58:18Z Indexed on 2010/06/09 17:02 UTC
Read the original article Hit count: 196

Filed under:
|
|
|

I'm writing some javascript that will insert some input fields into a form on a website.

The thing is, I don't want those input fields to affect the form in any way, I don't want them to be submitted when the form is submitted, I only want my javascript to have access to their values.

Is there some way I could add some input fields into the middle of a form and not have them submitted when the form is submitted?

Obviously the ideal thing would be for the input fields to not be in the form element, but I want the layout of my resulting page to have my inserted input fields appear between elements of the original form.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html