ajax - SyntaxError: missing : after property id jquery -
i using jquery operation of clicking submit button. doing validation of form , require 1 value form, not all.. seems well, getting error..
$('#tabs-1').on('click', '#showme', function(e){ $("#form13").validate({ debug: false, rules:{ trainerss:"required", }, messages:{ trainerss:"please choose trainer", }, submithandler: function(form) { $.ajax ({ var trainerss=$("#trainerss").val();//error shows line var datastring='trainerss='+trainerss; type: "post", url: "action.php", data: datastring, cache: false, success: function(response) { $('.result14').html(response); } }); } }); });
my form
<div id="tabs-1"> view trainer performance<br><br> <form id="form13" name="form13" action="" method="post"> <input type="hidden" name="myformsname" value="form13id" id="myformsname"> <select name="trainerss" id="trainerss" class="trainerss"> <option selected="selected" value="">--select trainer--</option> <br> <option value="one">1</option> <option value="two">2</option> <option value="three">3</option> </select><br> <input type="submit" value="display!" id="submit13" name="submit13"/> <br><br> </form> <div class="result13"></div> <input type ="button" id ="showme" class="showme" name="showme" value="show member list"/> <div class="result14"></div>
thanks in advance!!! form validates , value of trainerss pass on when used submit button(submit13), button showme,shows error..
change ajax call :
$.ajax ({ type: "post", url: "action.php", data: {trainerss : $("#trainerss").val()}, cache: false, success: function(response) { //your treatment } });
Comments
Post a Comment