Hidden field value set with jQuery doesn't submit
- by Will
I'm completely perplexed. I set the value of a hidden field with jQuery and the submit the form. The hidden value is present when I dump the $_POST array via PHP unless I use Internet Explorer.
Here's the test code:
$('#hidden-field').val('I am a hidden value');
// To make sure it's setting properly ...
// This shows its being set in FF, Chrome, **AND** IE
alert($('#hidden-field').val());
Then on the PHP side:
print_r($_POST);
For submissions made with IE the result looks like this:
Array
(
[hidden-field] =>
)
Other browsers have the value. Help? Why doesn't the value submit and how can I make it?