Promblems Ajax Checkbox Value
RegisterLogin
Promblems Ajax Checkbox Value
Post Description: Having Some Problem With Ajax Checkbox Value In The Web Form, I Had A Field Type Checkbox, So When I Would Submit The Form, The Post Information Would Always Be The Value Of The Forms
Tags: promblems, ajax, checkbox, value
This Post Was Posted On Feb 12, 2010 By Webune Support #3134
Post Description: Having Some Problem With Ajax Checkbox Value In The Web Form, I Had A Field Type Checkbox, So When I Would Submit The Form, The Post Information Would Always Be The Value Of The Forms
Tags: promblems, ajax, checkbox, value
This Post Was Posted On Feb 12, 2010 By Webune Support #3134
Promblems Ajax Checkbox Value by Webune Support
in the web form, i had a field type checkbox, so when i would submit the form, the POST information would always be the value of the forms.
for example. this is how the checkbox input field looks like:
<input type="checkbox" id="agree" name="agree" value="1">
so normally, if you have check the checkbox, then the default value would apply, in this case 1,
but even after submitting the form without checking the checkbox, the value would still be 1?
what am i doing wrong? OK, i finally found out what i was doing wrong. in my javascript code i had declared the value of my ajax field to the value instead of checked so i changed it and it worked:
BEFORE:
var terms = document.getElementById('terms').value;
AFTER:
var terms = document.getElementById('terms').checked;
do you see the difference?
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Wed Dec 21, 2011 8:53 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3