Phone Number Validation:
<Label text="Phone" />
<Input value="" id="phone" maxLength="10"></Input>
<Input value="" id="phone" maxLength="10"></Input>
var no =this.getView().byId("phone").getValue();
if(no ==""){
sap.m.MessageBox.alert("Please write your Phone Number");
return false;
}
else if(isNaN(no) || no.length === 10){
alert(" enter valid number");
return false;
}
Note - "isNaN(no)" for not to take characters in Input
"no.length" to take only 10 digits in input fiels
if(no ==""){
sap.m.MessageBox.alert("Please write your Phone Number");
return false;
}
else if(isNaN(no) || no.length === 10){
alert(" enter valid number");
return false;
}
Note - "isNaN(no)" for not to take characters in Input
"no.length" to take only 10 digits in input fiels
Enpersol Technologies offers services ranging from SAP consulting, sap implementation, sap validation, support Partners, Sap Consultant, SAP Rapid Deployment services in pune and indore.
ReplyDelete