Jump to content
  • Advertisement
Sign in to follow this  
Joran

ASP QUESTION

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guys, i need help, it need something but i dont know how i am going to pull it off. Let's say i have a dbase with 2 tables. Table A and Table B (identical tables just other data, isnt relevant). Let's say i create on my form 2 radio buttons. When i press radio button 1 i want to add to my form a selectionbox(Contents Table 1), when i click the second radio button,same selectionbox, is filled with Contents Table 2. I know how to pull a query aso, but how i am going to create a dynamic selectionbox. I tried the form methode methode, but i dont understand how we are going to know what selectionbox was pressed. If you could help me with this one, thx. Grtz Joran P.S. I have no problem writting C aso but webdesign (asp,php) it gets though my head. Oleee.

Share this post


Link to post
Share on other sites
Advertisement
The selection box has to have a value associated with it. here:




<form name="f">
<input type="radio" name="rad" value="1">First selection<br>
<input type="radio" name="rad" value="2">Second selection</br>

<select name="dropdown">
<option value="1">First selection</option>
<option value="2">First selection</option>
</select>
</form>

In your ASP code:

<%
Dim RadioButtonSelection
Dim DropDownSelection

RadioButtonSelect = Request("rad")
DropDownSelection = Request("dropdown")



Share this post


Link to post
Share on other sites
Thx for the help, but i think you didnt understand what i was trying to say.

This is your code :
<form name="f">
<input type="radio" name="rad" value="1">First selection

<input type="radio" name="rad" value="2">Second selection


<select name="dropdown">
<option value="1">First selection</option>
<option value="2">First selection</option>
</select>
</form>

In your ASP code:

<%
Dim RadioButtonSelection
Dim DropDownSelection

RadioButtonSelect = Request("rad")
DropDownSelection = Request("dropdown")


Now i know what radiobutton was selected or what dropdown was selected but
in the ASP code itself how can i change the contents of my selectionbox.

I want something like this, and your help is very good but i am still missing something.


Next line of Code(your code):
if(RadioButtonSelect = 1)
//Change the entire contents of the selectionbox dropdown with table 1
else
//Change the entire contents of the selectionbox dropdown with table 2
end if



The commands or let's methodes to change a objects contents of a selectionbox.
I dont know how you do that in asp or vbscript or aso.

But Thx for the help.

Share this post


Link to post
Share on other sites
What you'll need to do then is when you write your elements, you'll need to place the "selected" flag within then. I think it's selected for both radio and options. If selected doesn't work then try checked instead.

<input type="radio" name="x" value="y" selected>
or maybe
<input type="radio" name="x" value="y" checked>

<option value="y" selected>

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!