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!

please help this newbie 1

Status
Not open for further replies.

Goat

Programmer
Jul 13, 2000
36
DK
Greetings
I have to revamp an existing website. Part of the job included work with an access database. Now, I have to recreate the database search page.

Please take a look at this page

As u will see there is two radio buttons and one drop down menu. How do I make so when a radio button is click the contents of the drop down menu changes? I believe this would be javascript but I'm not really sure.

But in UD I have got the database connection working but, well, I just dont know what I'm doing. I have done the tutorials in UD but this seems quite different. I really hope someone can help

thanks
 
What you have to do is bundle two different forms in the same page. The first one will be recursive (ie. it's action will be the same page, so it posts to itself), and the second will have an action that points to the next page (wherever you want the data to go).

The radio buttons will be in the first form, and the list box and submit button will be in the second form.

You then have an onClick event for the radio buttons of:
onClick="document.recursiveFormName.submit();"

So that when a user selects his/her choice, the page reloads, giving you the opportunity to pick up their choice and build the list box accordingly.

so for instance:
Code:
<%
dim theChoice
theChoice = request.form(&quot;theChoice&quot;)

if theChoice <> &quot;&quot; then
  'build up your user defined sql statement here based on
  '   theChoice
else
  'build up your default sql statement here
end if

'open your connection and recordset with the sql statement
'   you built above
%>
.....................

<form name=recursiveForm method=post action=thisPage.asp>
<input type=radio name=theChoice value=1 onClick=&quot;document.recursiveForm.submit();&quot;>choice 1
<br>
<input type=radio name=theChoice value=2 onClick=&quot;document.recursiveForm.submit();&quot;>choice 2
</form>

<form name=theForm method=post action=destination.asp>
  <!--
    here's where you'll put your other stuff
    including your dynamic list box
  -->
</form>

hope that helps :)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top