1
Answer

Vaildate form input Using Ajax and regex

Sajid Hussain

Sajid Hussain

10y
819
1
i have a web form application ,in which have different form to get user data.i have used regex in the input form simply as validation expression.But i want to check user input and quick response him about his input data that what is to add and check the input for not empty using ajax ,my fields label are ,name (just alphabet and space),rollno(digits+/ ) ,phone no etc
 
Answers (1)
0
Arunava Bhattacharjee

Arunava Bhattacharjee

NA 6.2k 1.2m 10y
You can do this with JQuery


$(function(){
$("input[id$='txtTest']").bind('keypress', function(){
if($(Your Regex Comparison with TextBox value)
$("[id$='message']").text('correct your input. it should be in form of : ');
else
$("[id$='message']").text('');
});
});


Mark it as accepted if it works for you!