XModPro

How do I get the "value" of a checkbox

Eric Fox Eric Fox asked Sep 1, 2017
Active Sep 1 · Viewed 1478 times
<p>I have a form that has multiple checkboxes and when the user clicks a "next" button, ajax tries to call a feed and passes in whether the check boxes are checked or not, with the following. How do I pass in whether the checkbox is checked or not? I've tried .prop, .is("checked") and about everything i've found online but it always returns false. </p> <p>$.ajax({ </p> <p> url: '/DesktopModules/XModPro/Feed.aspx', </p> <p> type: 'POST', </p> <p> dataType: 'html', </p> <p> data: { </p> <p> "xfd" : "InsertVisionStatementEvaluation", </p> <p> "pid" : 2, </p> <p> "UserID1" : [[User:Id]], </p> <p> "PortalID1" : [[Portal:Id]], </p> <p> "VisionID" : 6, </p> <p> "Comments" : $('#Comments').val(), </p> <p> "Q1" : $('#Q1').val(), </p> <p> "Q2" : $('#Q2').val(), </p> <p> "Q3" : $('#Q3').val(), </p> <p> "Q4" : $('#Q4').val(), </p> <p> "Q5" : $('#Q5').val(), </p> <p> "Q6" : $('#Q6').val(), </p> <p> "Q7" : $('#Q7').val(), </p> <p> "Q8" : $('#Q8').val(), </p> <p> "Q9" : $('#Q9').val(), </p> <p> "FormName" : "step1" </p> <p> }, </p> <p> success: function(data) { </p> <p> alert(data); </p> <p> }, </p> <p> error: function (xhr, ajaxOptions, thrownError) { </p> <p> alert(xhr.status); </p> <p> alert(thrownError); </p> <p> } </p> <p> }); </p>

0 Answers

Loading answers...