Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: RE: asptoday_discuss digest: June 13, 2002


Message #1 by "Bryan Ax" <bax@k...> on Fri, 14 Jun 2002 10:26:07 +0900
Jeremy:

One last thing. Sometimes it's helpful to keep all those states in
either an external text file, XML file, or database. That way, you can
just call out, iterate thru the information and display.

StateInfo saved as....

StateCode, StateName
AZ, Arizona
AK, Alaska
AR, Arkansas
CO, Colorado
etc.

set rs = GetStateInfo() 'let's say this gets your states as a recordset.
DB or openfile() code not included for simplicity.

do while not rs.EOF
	response.write "<option value=""" & rs("StateCode").Value & """"
	if request.Form("cState") = rs("StateCode").Value then
Response.Write( " selected")
	response.write ">" & rs("StateName").Value & "</option>"
	rs.Movenext
loop

rs.Close
set rs = NOTHING

makes it much easier to see. Also allows you to reuse that state
information in several places, if you were to have a need for that. As
you can see, this could then be expanded to all kinds of different
dropdown lists.

HTH, 

Bryan

Subject: RE: Maintaining State with Selection Menus
From: "Jeremy Palmer" <medicalendar@h...>
Date: Thu, 13 Jun 2002 18:54:12
X-Message-Number: 6

Thank you!  That should solve the problem.

Best Regards,


  Return to Index