How to give validation to registration page in phonegap Android like we see in websites?

StackOverflow https://stackoverflow.com/questions/17668608

سؤال

Hi I have created an registration page I want to give validation to it like the one we normally see in the websites Means if any field is blank it should show it in red with message not like we normally use dialog box or alert can any one tell how to do this.I am not using form to create pages i used div. Thanks in advance.

هل كانت مفيدة؟

المحلول

you can use javascript to validate your textbox registration like

$('#btnReg').click(function(){
      if($('#textField').val().length==0){
           // show you massage in div here
           // like this
           $('#MsgError').html("error msg");
           // or use alert
           alert("error msg");
      }
})
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top