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!

Compare current vs. other dynamically generated fields?

Status
Not open for further replies.

tjock

Programmer
Nov 9, 2001
9
0
0
US
I have dynamically created courses and their schedule on a form page which I verified submit fine to an action page. My only problem is I can't get the action page to detect a time match (schedule conflict). Any ideas?
<!---form page--->
<INPUT TYPE=&quot;Checkbox&quot; NAME=&quot;checkbox#GetCourseList.currentrow#&quot; VALUE=&quot;#CourseNumber#&quot;>
<cfif #MondayTime# IS NOT &quot;&quot;><input type=&quot;hidden&quot; name=&quot;MondayTime#GetCourseList.currentrow#&quot; value=&quot;#GetCourseList.MondayTime#&quot;></cfif>

<!---Action page: Loop over all times--->
<cfloop from=&quot;1&quot; to=&quot;#Form.numGroups#&quot; index=&quot;iGroup&quot;>
<!--- Deterine whether this times checkbox was checked --->
<cfset tmp = SetVariable(&quot;currCheckbox&quot;, &quot;Form.checkbox&quot; & iGroup)>
<cfparam name=&quot;#currCheckbox#&quot; default=&quot;&quot;>
<cfoutput>
<cfif Evaluate(currCheckbox) is not &quot;&quot;>
<cfset tmp = SetVariable(&quot;currMondayTime&quot;, &quot;Form.MondayTime&quot; & iGroup)>
<!--- Compare this time to each other time --->
<cfloop from=&quot;1&quot; to=&quot;#Form.numGroups#&quot; index=&quot;jGroup&quot;>
<!--- Skip the comparison if we're dealing with the same time--->
<cfif iGroup is not jGroup>
<cfset tmp = SetVariable(&quot;otherMondayTime&quot;, &quot;Form.MondayTime&quot; & jGroup)>
<cfif Evaluate(&quot;currMondayTime&quot;) is Evaluate(&quot;otherMondayTime&quot;)>
The times match.
</cfif>
</cfif>
</cfloop>
</cfif>
</cfoutput>
</cfloop>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top