I have a hidden form field:
<input type=hidden id=blah1 value=true />
I have abutton, when clicked I do:
$("#b1").bind("click", function(){
$("#blah1").attr("value", "false");
});
But when I get the form value on the server side, it is ‘true’.
Am I doing something wrong?
I even did this:
e.preventDefault();
$("#blah1").attr("value", "false");
alert( $("#blah1").attr("value") );
It alerted the value ‘false’.
You did include the ‘name‘ attribute in your real code, no?
This still doesn’t explain why you see “true” on the server side. If you did include the “name” attribute on your hidden field, please post your server-side code.
Running the code you have posted here, once the “name” attribute is added, achieved the expected “False” result.