Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am inserting drodownlist Value into gridview...but once its inserted,i dont want to inser it again that value...for that validation what will be the javascript.
Posted

You have to write your own logic for insertion feature. You have to keep track of all the values so far used and based on it avoid the selection of that item from dropdown. Alternatively, once a particular dropdown value is selected, you can remove the same from the list so that it is no more available for user selection.
 
Share this answer
 
Comments
ujali 22-Dec-12 5:50am    
i want to give a validation to that dropsownlist that Item is already exists??i have write my own logic for insertion
Sandeep Mewara 22-Dec-12 5:54am    
As said, you need to write validation on your own. either store used value or use XMLHttpRequest to get the used values and then validate if the selected value is ok to be inserted or not.
ujali 22-Dec-12 5:59am    
can u give me the sample javascript code for this?
Sandeep Mewara 22-Dec-12 6:04am    
There is nothing to sample out here. Define a XHR and get back the values used. Use a for loop to see if the selected value is already in the returned XHR response. If not, go ahead with selection or else give an alert that it is already selected.
ujali 22-Dec-12 6:14am    
how to take values by using Xmlhttprequest...Syntax?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900