Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
hi all,
my requirement is.
I have two dropdownlist firt dropdownlist name is ddlstockname and second one is ddldepartmentname
suppose first time i selected in ddlstockname is "papers" and first time selected ddldepartmenname is
"lab" . second time if i select same "papers" and "lab" i want display one message box like this stockname already given to
"lab" department. if ddlstocknaem select "papers" and select another ddldepartmentname it's ok.
please send me . thankyou.
Posted
Comments
Vani Kulkarni 13-Jul-12 5:00am    
What have you tried till now?
Vani Kulkarni 13-Jul-12 5:24am    
Moving questions from Jeyamothi:
I have some questions
1. are you display the message at "submit" click or at the time of ddldepartmentname click event?

2. Are you store the selected value into database or store any where?

1 solution

please send me
What code? It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.



For now, what you seek is validation from server side if a particular value in dropdown was selected earlier. To do it with good user experience, you need to use Javascript. Talk to server using Javascript and get back the response if it was preselected.

Steps:
1. raise a JS method on change of dropdown value
2. pass on the current selected item id to Javascript method
3. send a XMLHttpRequest or Callback to server for response on the current selected item id
4. based on the response show the message.

Now, try out, post specific issue if you face.
 
Share this answer
 
Comments
AshishChaudha 13-Jul-12 9:38am    
good answer..my 5!

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