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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down dynamic same page

Status
Not open for further replies.

tictaclam

Programmer
Jan 8, 2004
47
US
Hi
I have a drop down menu and a "go" button. When "go" is clicked i need to get the value of the drop down menu. I thought of using a form but i need the value on the same page to finish some calcuations (in asp). I went through the FAQS but the problem i am facing is that i need the value of the drop down menu in the asp code so i can use it in calcuations. Is there any way to get the value without using a form? Or is there any way to get the value on the same page? Thanks
 
I'm not sure what you are trying to do, but just remember that ASP processing occurs on the server, BEFORE the page is displayed by the browser. If your intent is to have the user make a selection then perform some calculation, those calculations will have to be in client-side script or you will have to re-submit the page.

You can use a form and send the value of the dropdown menu back to the same page to complete your calculations. It doesn't have to call a different page.
 
this is more a javascript question but here goes :

<select name="dropdown">
<option>1</option>
<option>2</option>
</select>

<input type="button" onclick="alert(document.getElementById('dropdown').value);">

[thumbsup2]DreX
aKa - Robert
 
in answering fast i seemed to have missed the "need value for calc in asp"

in order to use the drop down value in calculating in asp, you're oing to need to submit the form and request the drop down's value in order to do your calculation, this will be very similar to drop downs that affect each other ( tree structure )

see the faq : faq333-1498


[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top