View Full Version : reload page w/ querystring using onclick

01-15-2003, 02:20 AM

I'm just getting started with javascript so any help with this will be greatly appreciated!

I have a page with a form on it.

The first field is named Search Type, with 2 radio button options, A and B.

A is the default, however when a user clicks B, a different set of search criteria follows beneath.

My thinking is to add a querystring (page.asp?SEARCH_TYPE=B) with a function then reload the page, collect the variable and carry on.

Here's what I have so far:


If Request.QueryString("SEARCH_TYPE") <> "" Then
SEARCH_TYPE = Request.QueryString("SEARCH_TYPE")
End If


<script language="javascript">
function A_on(){
function B_on(){


<form action="page.asp" method="post" name="form1">
<td>SEARCH TYPE:</td>
<input type="RADIO" name="SEARCH_TYPE value="A"<% If SEARCH_TYPE = "A" Then Response.Write " checked" End If %> onClick="A_on();">A<br>
<input type="RADIO" name="SEARCH_TYPE" value="B"<% If SEARCH_TYPE = "B" Then Response.Write " checked" End If %> onClick="B_on();">B

*** I used this method successfully elsewhere, but it's not working here. The difference is that on the successful one the form submits to a different page, and not to itself like this one does.

Is there some other way to "reload a page" using those functions instead of "submitting" it like they currently do?

Thank you!