Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down List Access differenly from Server than Javascript

Status
Not open for further replies.

dev2006v2

Programmer
Joined
Feb 17, 2006
Messages
5
Location
US
Hello
I am populating the some controls at server side and others with Javascript because I am using AJAX.

The two Drop Down List gets populate by Javascript but when the user clicks "Search" button, then the server needs to get the selected values of the two drop down list to be processed at server side. The problem is that Javascript uses Form1.ddlName.options.text and Form1.ddlName.options.value. But server looks for
ddlName.selectedtext and ddlName.selectedindex. I can't get the value that the user has selected because it was populated by Javascript.

How can I pass the selected value to server? Someone recommended to store the value to a hidden field. I was able to set the hidden field value but I can't pick up the value on the server side.

Please Help!!!!
Thank you.
 
If you're populating the hidden field correctly, and the field is inside the form, then you'd need to ask in the forum for whatever server-side language you're using on how to pick up form field values.

As I say - this is assuming you're populating the hidden field correctly.

Of course, I don't understand why you need a hidden field at all. You should be able to pick up values from any form field regardless of how it was set. As long as the field is in the form, not disabled, and has its value set before the form submission, you should be able to pick it up no problem server-side.

Maybe your server-side code is screwed? Again, for this, you'd need to ask in a more relevant forum.

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top