I am trying to validate text input, with a sql check. Based on the result from the ajax call, I want to return the output as red or green.
HTML:
<script>
$("#cdsid").click(function() {
debugger;
var value = $.trim($("#svcdsid").val());
if (value != '') {
$.ajax({
type:"POST",
url:"SVCDS_filter.cfc?method=SVCDSIDExists",
data: "value",
cache:false,
dataType: "json",
success: function(){
alert('YES');
},
error: function(){
alert('NO');
}
});
} else {
$("#targetDiv").html("Please Enter SSID");}
});
</script>
I am getting "unexpected end of input". In debugger, after checking that the value is not null value, it skips to the end code. I am not sure why.