Forum Moderators: open

Message Too Old, No Replies

A form field that does not get submitted -- possible?

         

hoju312

5:19 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



I have a form with a bunch of fields and I want one to not be submitted. It is only used in cunjunction with the field that follows it so I don't want the first to submit any info. Is this possible?

ChadSEO

7:30 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



hoju312,

If you disable the element, then it will not be submitted with the form. You can do this with javascript, like this:

<form action="page.php" method="post" onsubmit="this.form.nogood.disabled=true;">
<input type="hidden" name="nogood" value="null">
</form>

This will disable the "nogood" input when the form is submitted. Note that this does rely on Javascript, so if JS is disabled, then the field will be submitted with the form. The safe approach would be to ignore the field on the next page, if that's possible.

Chad