Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Eymard #1
Incorrect results in <cfloop>
Hi,
I have 4 different dropdown of courses with courseID together with its data,
PlayDate. Let say I have selected course 1, 2, 3 4 but when I insert in my DB I
can?t insert the corresponding PlayDate and Number of players with its correct
courseID I have selected. I have tried to use evaluate but still gives me
error. Can anyone help me?
<td>
<select name="selectcourse" size="1" class="style5" id="selectcourse"
onchange="javascript:copy()">
<option value="" selected>-- Choose Alternate Course No. 1 --</option>
<cfoutput query="getAlterNateCourses">
<option value="#CourseID#">#name#</option>
</cfoutput>
</select>
</td>
<td>
<td align="center" class="smv">
<input type="text" name="PlayDAte" value="#PlayDate#" size="10"
maxlength="12" class="smv">
</td>
<td align="center" class="smv">
<input type="text" name="NumPlayers" value="#NumPlayers#" size="10"
maxlength="12" class="smv">
</td>
<CFLOOP index="IDX" list="#Form.selectcourse#" delimiters=",">
<cfquery name="InsertRound" datasource="#DSN#">
INSERT INTO client_CourseCart(
cartID,
PlayDay,
NumGolfers)
VALUES (#courseID#,
'#Evaluate("PlayDay_" & IDX)#,
#Numplayers#
PlayDay
</cfquery>
</ CFLOOP>
Please advice how can I loop through my courseID with correct PlayDay and
Number of Player I have provided.
Thanks
Eymard Guest
-
#40003 [NEW]: strtotime(), incorrect results
From: matt at iws dot co dot nz Operating system: Linux 2.4 PHP version: 5.2.0 PHP Bug Type: Date/time related Bug... -
CFloop through Form results
I'm trying to set a value of 1 or 0 if any Radio on a form submission (loop) is labeled 'OutofService'. The form is looped by Radio_ID. The... -
Collision modifier giving incorrect results?
Does anyone know of any reason the Collision modifier would report a false collision on models, type #box, with scale different than vector(1,1,1)? -
Incorrect results on DB2 UDB v7.2
Anyone recognised the following bug (is there an APAR)? Incorrect results can be returned when using IN lists of string literals and then... -
Re Incorrect results on DB2 UDB v7.2
Further to previous post , please ignore - the following fixpak 8 APAR (originally for AIX) looks near-identical, certainly worth a shot: ... -
Eymard #2
Re: Incorrect results in <cfloop>
Hi,
I assume I have not posted the right question here that is why I am not
getting an answer?
I would like to elaborate more on the above, I am trying to insert a record
in my DB, I have four different pulldowns and a series of textboxes. Each
pulldown i.e. CourseID has playdate, number of players. Now, for example I have
selected pulldown number 2 with courseID 212 and enter PlayDate on and also
number of players textboxes. I have again selected pulldown number 4 with
courseID 215 and entered PlayDate and number of players.
I press submit to insert the record in my DB but how can I evaluate my thoses
elements that I have selected and entered in pulldown number 2 and pulldown
number 4 and its suceeding row elements?
I hope posted the right question.
Thanks for the help.
Eymard Guest
-
dempster #3
Re: Incorrect results in <cfloop>
I think the problem is that your question is not clear. Do you mean that you
have multiple instances of the selectcourse input field in your form? As well
as multiple PlayDate and NumPlayers fields? And you want to match them up?
What I would do in a case like this is use a loop to generate a form with
different field names. Then you would have: selectcourse1 PlayDate1
NumPlayers1 selectcourse2 PlayDate2 NumPlayers2 etc. Then in your program
that processes the form, you would loop again and insert the correct fields
into your database: #Evaluate('Form.selectcourse' & loopindex)#
#Evaluate('Form.PlayDate' & loopindex)# #Evaluate('Form.NumPlayers' &
loopindex)# Your example also has a JavaScript function set to an onchange
event. Not sure what that does, but you shouldn't need it with this approach.
-Paul Paul Dempsey Dickinson College
dempster Guest
-
Eymard #4
Re: Incorrect results in <cfloop>
Thank you very much for the input. Yes, I want to match up the form elements
that I have filled in. But I have a dynamic pulldown for selectcourse listbox
that changes when I selected different course.
i.e.
selectcourse1=212 PlayDay1212=03102005 NumberOfPlayers1212=4
selectcourse2=234 PlayDay2234=03222005 NumberOfPlayers2234=2
selectcourse3 PlayDay1 NumberOfPlayers3
selectcourse4=126 PlayDay1126=03302005 NumberOfPlayers4126=4
When I do a cfloop, I could not match the selected courseid with the
succeeding form elements. I am not using the Javascript function now. I have
tried it using javascript to create a dynamic formname elements to easily loop
through it but has no luck.
Any further explanations? Thanks again.
Eymard Guest



Reply With Quote

