Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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 existing mobile value and fail to disable submit button When I passed value in text field by value = following code

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

here is my java script

`<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>`

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Did you try triggering oninput function manually?

$("#mble").trigger("input");
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading