Ive written an If in javascript that checks that the entry of a text box begins with 'at'. If the string entered begins with 'at' then it will run function showInput() and if it doesnt start with 'at' than an error message will be displayed.The ID of the textbox is "Command". My if is displayed below :
function validate(){
var Command = 'at';
if( Command.indexOf('at')< 2 ){
showInput();
}
{
else alert('Please enter valid AT command.');
}
}
cheers all.
Aucun commentaire:
Enregistrer un commentaire