I recommend you read a JavaScript tutorial. Try here.
To answer your question, this will probably work. If you’re wondering why you’re getting downvoted – asking people to write your code for you is generally considered bad form, so try not to do this in future. 🙂
function Validateform(e) {
if (document.getElementsByName('receiver')[0].value.substring(0, 2) !== "92") {
e.preventDefault();
alert("Alert");
}
}
solved Check if a text box starts with 92 using javascript [closed]