Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
133
rated 0 times [  139] [ 6]  / answers: 1 / hits: 22993  / 14 Years ago, tue, january 25, 2011, 12:00:00

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'.


More From » jquery

 Answers
7

You did include the 'name' attribute in your real code, no?



<input type=hidden id=blah1 value=true name=blah1 />


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.


[#94053] Monday, January 24, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
carlymykalac

Total Points: 740
Total Questions: 91
Total Answers: 91

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
carlymykalac questions
Fri, Dec 10, 21, 00:00, 3 Years ago
Mon, Sep 2, 19, 00:00, 5 Years ago
;