Oninput event not working when value in text field is passed from another form

oninput event work absolutely fine whenever I entered mobile number in my small form text field. (as on entering, its show text that number already exist and disable submit button) . But its fails to check exisiting mobile value and fail to disable submit button When I passed value in text field by value = “<?php echo $mble; ?>” following code

<label>Mobile:</label> <input type="text"  name= "mble"  id= "mble" **value="<?php echo $mble; ?>"** class="form-control" Required maxlength = "12"  oninput="checkAvailability()">

and here is my script code

<script type="text/javascript">     

function checkAvailability() {
$("#loaderIcon").show();
jQuery.ajax({
url: "proceser.php",
data:'mble='+$("#mble").val(),
type: "POST",
success:function(data){
$("#user-availability-status").html(data);
$("#loaderIcon").hide();
if(data == "<span class=''> Mobile No already exist.</span>") {
$('#submit').prop('disabled', true);
}
else $('#submit').removeAttr('disabled');
},
error:function (){}
});
}
</script>

Define “fails to check” - does it execute the function? Does it send the AJAX request? Does the AJAX request come back with the right value?

by adding this in java script code, my code start working

$("#mble").trigger("input");

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.