Posts

Showing posts with the label form

change checkbox value using ajax

I was working on jqgrid changing the status 0 and 1 in database by checking the the checkbox in grid.Problem i faced was as check the checkbox it update value through ajax,but it doesnt change value in checkbox for it needed to refresh the page.What i did is got response of status through ajax and change value of checkbox using                      var checkbox = $( "#"+status_id ); var ns = checkbox.val( checkbox[0].checked ? "1" : "0" ); i was getting the checkbox as json from php In which you can find example in jqgrid with php. sample code passed through json: <input type='checkbox' name='status'  id='status_".$temp."'  value='0' onchange='pathwaystatus($temp)' /> function to change status: function pathwaystatus(e) { //alert(e); var status_id = "status_"+e; //alert(status_id); var chkbxval = document.getElementById(status_id).value; //alert(chk...