I have a list of values in database.. while user types values in that text box i have to validate values . if the value already exists say already there else accepts the data. i dnt want to validate on form submission i want to validate on user input itself..
please help me
What you are looking for a autocomplete text field. Checkout the following links. you could find the idea.
1. Assign AutoPostBack=true to the textbox
2. Use TextBox_TextChanged event
1. Develop one ActionResult with Json return type and write code to get data list from database and return the same.
2. In View write jQuery keypress event handler and inside that write jQuery Ajax code to request list of record from json Method.
3. Finally iterate through each data from json array and validate input with that, if found populate error message and return false;
If it helps you, pls mark as Answer.