Click here to Skip to main content
13,258,055 members (48,180 online)
Rate this:
Please Sign up or sign in to vote.
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 21-Dec-12 20:55pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.
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?
Sandeep Mewara 22-Dec-12 6:20am
Have a look here:

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171114.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100