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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is happening in this code

Status
Not open for further replies.

vb89

MIS
Aug 21, 2008
47
US
Can someone please explain to me what is happening in the following code:

Code:
<SELECT name="cf" class="data" onchange="this.form.cftxt.value=this.options[this.selectedIndex].text;">
		<OPTION value="">Select Conference</OPTION>
		<%tempDivId = 0
		Set rsConf = SPSSconn.Execute(tConfSQL)
		Do While Not rsConf.eof 
			tempConfId = CInt(rsConf(0))
			If (tempDivId <> CInt(rsConf("cfb_division_id"))) Then
	            If (CInt(rsConf("cfb_division_id")) = 1) Then
					Response.Write "<OPTION value="""">-------- Division I-A ----------</OPTION>"
				Else
					Response.Write "<OPTION value="""">-------- Division I-AA ----------</OPTION>"
				End If
				tempDivId = CInt(rsConf("cfb_division_id"))
			End If
			%>
			<OPTION value="<%=tempConfId%>" <%If iConfID = tempConfId Then%>selected<%End If%>><%=rsConf(1)%> (<%=rsConf(2)%>)</OPTION>
		<%rsConf.movenext
  		Loop
  		rsConf.close
  		Set rsConf = Nothing%>
 
are you sure this is an asp.net project, because this looks alot like asp.

the developer was using html and server code to generate a drop down list. however if this is asp.net there are much easier ways of doing this.

the first option is blank (select conference)
the next option will iterate over a record set and enter either Division 1 or 2 options. the very last option is selected by default if some criteria is met.

after all that the record set is closed set to nothing.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top