Skip to content
Advertisement

JavaScript submit form excluding fields

I have a simple html form:

JavaScript

And I need to submit it with JavaScript, but I want to exclude the dontSubmitThisField field from the request. Is there a way of doing that without Ajax?

Advertisement

Answer

Just disable the field.

Either do it via HTML if the field cannot be updated by the user: http://www.w3schools.com/tags/att_input_disabled.asp

Or do it via jQuery with a on submit event:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement