Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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
ujali439
Rate this: bad
good
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.
  Permalink  
Comments
ujali at 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 at 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 at 22-Dec-12 5:59am
   
can u give me the sample javascript code for this?
Sandeep Mewara at 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 at 22-Dec-12 6:14am
   
how to take values by using Xmlhttprequest...Syntax?
Sandeep Mewara at 22-Dec-12 6:20am
   
Have a look here:http://www.codeproject.com/Answers/121108/SQL-With-Javascript.aspx#answer2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 7,273
1 OriginalGriff 5,587
2 Peter Leow 4,097
3 CHill60 2,858
4 Mika Wendelius 2,850


Advertise | Privacy | Mobile
Web01 | 2.8.150224.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2015
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