Click to See Complete Forum and Search --> : Urgent:Submitting The ASP FORM


March 1st, 2000, 10:56 AM
Hi,
I am developing an ASP form Which contains three combo boxes.I have to
populate the values in other combo boxes based on the selection in one combo box.When the First combo box Change event occurs,I have to submit the form
to filter the records for the second combo.
Please give me some sample code.
Thanx in Advance.

Love,
Ram

Johnny101
March 1st, 2000, 11:42 AM
Heres a sample of how to post a form to another asp page:

'yourpage1.asp will post to yourpage2.asp

'build the input form in HTML
<form method=post action=yourpage2.asp>
<select name=DropDown1>
<option value=1>The First option</option>
<option value=2 selected>The Second option</option>
<option value=3>The Third option</option>
</select>

<input type=submit value=' Submit Form '>  <input type=reset value' Reset Form '>
</form>



when the user clicks the submit button the choice will be passed to yourpage2.asp, as follows:

'yourpage2.asp

<%@ Language=VBScript %>

<html>
<body>
'a bunch of layout design and whatnot...

'place where you need to know what was chosen from the previous page.
<%
dim iChoice

iChoice = Request.Form("DropDown1")

Select Case iChoice
Case 1
Response.write "You chose the first option.<BR>"
Case 2
Response.write "You chose the second option.<BR>"
Case 3
Response.write "You chose the third option.<BR>"
End Select
%>

'the rest of your html page.
</body>
</html>




You should be able to see what is going on with the previous page's form values and how to work around that value. In the select block, you would build a string that holds the HTML for the next drop down box. you would obviously change the available options in the drop down depending on the value of iChoice (or whatever you called it).

i hope this helps,
john

John Pirkey
MCSD
www.ShallowWaterSystems.com