Restrict or show warning if user not selected item in the list

Posted by Bhanubysani under ASP.NET on 4/10/2013 | Points: 10 | Views : 957 | Status : [Member] | Replies : 1
Hi All,

I am using jquery auto complete extender feature to enter city or cars in the text box.

i am getting data in data set i am lopping the data set and separated with commas i am assigning to hidden filed.

in text box focus i am sourcing the data to from hidden filed using the below code.

function CityAutoComplete() {
var CityautocompleteVal = document.getElementById('<%=CityAComplete.ClientID %>').value.split(",");

$(document.getElementById('<%=txtCity.ClientID %>')).autocomplete({ source: CityautocompleteVal });

//CityautocompleteVal --> hidden field

my problem is some times user is not selecting the text from list.

i want to validate the text and show warning message or nee to restrict the suer to enter the text.

Please help me whether it is possible from client side.


Bhanu Prakash Bysani


Posted by: Jitendrasoft09 on: 4/10/2013 [Member] [MVP] Starter | Points: 25

There to be added the javascript function which validates the list item to text entered value, if not matched to show error, or keypress event to be called to restrict the wrong data.
Plz refer below link that would be helpful-

jitendra kumar

Jitendra Kumar
If my post helps you, plz mark as an answer.

Bhanubysani, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response