Preventing form items from being sent to the server
Moderator: General Moderators
Preventing form items from being sent to the server
Usually, when clicking on a 'submit' button, the form sends all the 'value' attributes within the form to the server. But is there a way to not send the 'value' attribute of form elements which are invisible (style="display:none")? 
Re: Preventing form items from being sent to the server
You could use JavaScript to actually remove the elements from the form.
But otherwise no. Can't you just ignore them?
But otherwise no. Can't you just ignore them?
Re: Preventing form items from being sent to the server
I got it and the answers pretty simple too! Just add disabled="disabled" to the item and it won't be sent along with $_POST. How ironic that I was thinking of using AJAX or PHP when HTML could already do the trick for me. This proves that the right answer we're looking for is sometimes just under our noses. 