Click here to Skip to main content
15,902,112 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHow can I close the first page? Pin
ATC17-Aug-04 2:55
ATC17-Aug-04 2:55 
AnswerRe: How can I close the first page? Pin
ChrisAdams17-Aug-04 17:14
ChrisAdams17-Aug-04 17:14 
GeneralASP calling a DLL Problem!! Pin
Jason Jefferies16-Aug-04 23:04
Jason Jefferies16-Aug-04 23:04 
GeneralRe: ASP calling a DLL Problem!! Pin
wegerjos19-Aug-04 1:41
wegerjos19-Aug-04 1:41 
GeneralRemoving and replacing the bottom border of a table cell in Netscape Pin
Anonymous16-Aug-04 5:05
Anonymous16-Aug-04 5:05 
General<TEXTAREA> ELEMENT TEXT COLOR DOESN'T CHANGE Pin
Brendan Vogt16-Aug-04 4:38
Brendan Vogt16-Aug-04 4:38 
GeneralDatabase Transactions Pin
Brendan Vogt16-Aug-04 4:37
Brendan Vogt16-Aug-04 4:37 
GeneralASP: Combo load and combo reset Pin
Brendan Vogt16-Aug-04 4:35
Brendan Vogt16-Aug-04 4:35 
I have a province combo, and a region combo, and an area combo. When a user selects a province, all the regions for that province must load. When the user selects a region, all the areas for that region must load. This works well. But my problem comes now. Once you have chosen the province, the region, and the area, select a different province. The new regions should load for that province, and because no region has been selected at this stage, there should be nothing loaded in the area combo. I do not know how to code this. I have been struggling and debugging for some time now. Nothing seems to work. The only way that I can get this right is if I do it in JavaScript. I want it done in ASP.

Here is my ASP code which is at the top of the page:

<%
'------------------------------------------------------------------------------------
' Variable declaration
'------------------------------------------------------------------------------------
Dim objForm
Dim intProvince: intProvince = 0 ' Default value
Dim intRegion: intRegion = 0 ' Default value
Dim intArea: intArea = 0 ' Default value
Dim boolIsPost
Dim intReferenceType, intSubscriptionType

' Connection and recordset variables goes here...

'------------------------------------------------------------------------------------
' Determine whether post is successful
'------------------------------------------------------------------------------------

boolIsPost = CBool(Request.Form("IsPost"))



If boolIsPost Then

' Get the numeric value of the selected index of the province combo
intProvince = CInt(Request.Form("province"))
' Regions and area should only load if a province is selected
If intProvince > 0 Then
intRegion = CInt(Request.Form("region"))
Else
intRegion = 0
End If
If CInt(Request.Form("region")) > 0 Then
intArea = CInt(Request.Form("area"))
Else
intArea = 0
End If

End If

'intArea = CInt(Request.Form("area"))
intReferenceType = CInt(Request.Form("cmbReferenceType"))
intSubscriptionType = CInt(Request.Form("cmbSubscriptionType"))

%>

The code that I have in my to load each combo is below. I have a function that loads the combo depending on the parameters:

Province combo:

<%

' Define SQL statement and open it
strSQL = "SELECT ProvinceID_PK, ProvinceName " & _
"FROM tblProvince " & _
"ORDER BY ProvinceName;"
objRs.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly

' Create and instance of the form class
Set objForm = New Form
Response.Write objForm.GetList("frmAgencyReg", "province", objRs, 0, 1, intProvince, True, True, False)
Set objForm = Nothing

' Close the recordset
objRs.Close

%>

Info »
Region combo:

<%

' Define SQL statement and open it
strSQL = "SELECT RegionID_PK, RegionName " & _
"FROM tblRegion " & _
"WHERE ProvinceID_FK = " & intProvince & " " & _
"ORDER BY RegionName;"
objRs.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly

' Create and instance of the form class
Set objForm = New Form
Response.Write objForm.GetList("frmAgencyReg", "region", objRs, 0, 1, intRegion, True, True, False)
Set objForm = Nothing

' Close the recordset
objRs.Close

%>

Info »
Area combo:

<%

' Define SQL statement and open it
strSQL = "SELECT AreaID_PK, AreaName " & _
"FROM tblArea " & _
"WHERE RegionID_FK = " & intRegion & " " & _
"ORDER BY AreaName;"
objRs.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly

' Create and instance of the form class
Set objForm = New Form
Response.Write objForm.GetList("frmAgencyReg", "area", objRs, 0, 1, intArea, True, False, False)
Set objForm = Nothing

' Close the recordset
objRs.Close

%>

Info »
Because I have a Request.Form for each field to retain the values when the page makes a trip to the server. How do I clear all the values when the page is refreshed?

This doesn't make much sense, so I am willing to send my files if requested.

I require help!!!

Thanks
Brendan
GeneralNetscape Constant Strings Pin
Brendan Vogt16-Aug-04 4:30
Brendan Vogt16-Aug-04 4:30 
GeneralThe RegExp Object Pin
Brendan Vogt16-Aug-04 4:29
Brendan Vogt16-Aug-04 4:29 
GeneralJavaScript - Validation Pin
Brendan Vogt16-Aug-04 4:27
Brendan Vogt16-Aug-04 4:27 
GeneralRe: JavaScript - Validation Pin
gmhanna18-Aug-04 15:35
gmhanna18-Aug-04 15:35 
GeneralCertificate Stores Pin
Gavin Jeffrey16-Aug-04 3:27
Gavin Jeffrey16-Aug-04 3:27 
GeneralAccess Web Browser Control Contents Pin
Asif Rehman14-Aug-04 17:07
Asif Rehman14-Aug-04 17:07 
GeneralExtracting the htm page from its shortcut Pin
mysorian14-Aug-04 4:53
professionalmysorian14-Aug-04 4:53 
GeneralRe: Extracting the htm page from its shortcut Pin
ChrisAdams15-Aug-04 19:33
ChrisAdams15-Aug-04 19:33 
Questiontable works in mozilla/firefox but not IE -- rowspan issue? Pin
sbeausol13-Aug-04 9:42
sbeausol13-Aug-04 9:42 
AnswerRe: table works in mozilla/firefox but not IE -- rowspan issue? Pin
Steven Campbell13-Aug-04 15:23
Steven Campbell13-Aug-04 15:23 
GeneralURL filter problem Pin
Vasek13-Aug-04 0:32
Vasek13-Aug-04 0:32 
GeneralRead &amp; Write INI Files Using VBScript Pin
Steve Meyers11-Aug-04 8:23
Steve Meyers11-Aug-04 8:23 
GeneralRe: Read &amp; Write INI Files Using VBScript Pin
alex.barylski12-Aug-04 5:29
alex.barylski12-Aug-04 5:29 
GeneralRe: Read &amp; Write INI Files Using VBScript Pin
Anonymous12-Aug-04 5:41
Anonymous12-Aug-04 5:41 
GeneralRe: Read &amp; Write INI Files Using VBScript Pin
alex.barylski12-Aug-04 11:35
alex.barylski12-Aug-04 11:35 
GeneralSaving result of xml/xsl transformation Pin
David Chamberlain11-Aug-04 7:01
David Chamberlain11-Aug-04 7:01 
GeneralRe: Saving result of xml/xsl transformation Pin
yourbuddy778-Sep-04 18:53
yourbuddy778-Sep-04 18:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.