Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
noobie05 #1
<CFFORM> halting Javascript?
Originally created .cfm to contain a dynamic object total to display
onChange="Total()" to a text input. It works in backup .cfm. I
recreated .cfm to be more economical with resources. Only difference
now is I am using <cfinclude template="_getColor.cfm"> within the form
that creates total. Is this
(excerpt from _getColor.cfm)
<cfform>
<cfselect id="Colors" message="Please Select Color" query="getColor"
name="Color" required="yes" value="Name">
</cfselect> </cfform>
found within
<form name="frmCalcCaps">
<tr>
<td><div align="right">Cap 1 </div></td>
<td><input type="text" name="Item1Quantity" onchange="Total()"
size="7"/></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><input name="UPCcap1" type="text" size="12"/></td>
<td><input name="cap1Price" type="text" size="6"/></td>
</tr>
..
..
..
<td><input name="CalcOutput" type="text" value="0"
size="7"/></td>
causing my form to not process JS correctly? Does anyone have clue to
what is wrong now? Thanks!
Lucas
Here is code for table
<table width="800" border="0" align="left" cellpadding="0"
cellspacing="5">
<form name="frmCalcCaps">
<script language="JavaScript">
<!--
function Total() {
var q, i, captotal, tax, sh, total;
captotal = 0;
nitems = 6;
for (i=1; i<nitems+1; i++) {
eval("q = document.frmCalcCaps.Item" + i +
"Quantity.value;");
if (q) {
eval("total=document.frmCalcCaps.Item" + i +
"Quantity.value");
captotal = parseInt(captotal) +
parseInt(total);
}
}
document.frmCalcCaps.CalcOutput.value = captotal
}
// -->
</script>
<tr>
<td width="45"><div align="center"></div></td>
<td width="47"><div align="center" class="style1">Qty</div></td>
<td width="134"><div align="center" class="style1">Cap Color
</div></td>
<td width="140"><div align="center" class="style1">Eyelet/Button
Color </div></td>
<td width="168"><div align="center" class="style1">Sandwich Color
</div></td>
<td width="119"><div align="center" class="style1">UPC Code
</div></td>
<td width="101"><div align="center"
class="style1">Pre-Price</div></td>
</tr>
<tr>
<td><div align="right">Cap 1 </div></td>
<td><input type="text" name="Item1Quantity" onchange="Total()"
size="7"/></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><input name="UPCcap1" type="text" size="12"/></td>
<td><input name="cap1Price" type="text" size="6"/></td>
</tr>
<tr>
<td><div align="right">Cap 2 </div></td>
<td><input type="text" name="Item2Quantity" onchange="Total()"
size="7"/></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><input name="UPCcap2" type="text" size="12"/></td>
<td><input name="cap2Price" type="text" size="6"/></td>
</tr>
<tr>
<td><div align="right">Cap 3 </div></td>
<td><input type="text" name="Item3Quantity" onchange="Total()"
size="7"/></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><input name="UPCcap3" type="text" size="12"/></td>
<td><input name="cap3Price" type="text" size="6"/></td>
</tr>
<tr>
<td><div align="right">Cap 4 </div></td>
<td><input type="text" name="Item4Quantity" onchange="Total()"
size="7"/></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><input name="UPCcap4" type="text" size="12"/></td>
<td><input name="cap4Price" type="text" size="6"/></td>
</tr>
<tr>
<td><div align="right">Cap 5 </div></td>
<td><input type="text" name="Item5Quantity" onchange="Total()"
size="7"/></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><input name="UPCcap5" type="text" size="12"/></td>
<td><input name="cap5Price" type="text" size="6"/></td>
</tr>
<tr>
<td><div align="right">Cap 6 </div></td>
<td><input type="text" name="Item6Quantity" onchange="Total()"
size="7"/></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><cfinclude template="_getColor.cfm"></td>
<td><input name="UPCcap6" type="text" size="12"/></td>
<td><input name="cap6Price" type="text" size="6"/></td>
</tr>
<tr>
<td height="20"> </td>
<td><input name="CalcOutput" type="text" value="0"
size="7"/></td>
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</form>
</table>
noobie05 Guest
-
Modify the javascript from CFFORM?
Hi, Is there a way to modify the javascript created by CFFORM. It seems to be created at run-time. I am trying to make one field required if... -
CFMX 7 javascript validation in CFform does not work
Hi, was hoping someone could help, Since upgrading to CFMX 7 from 6.1 all my cfform tags (100's of them!) have stopped recognising any cf javascript... -
CFFORM and Javascript
Hi, i was moving all the javascripts to .js files, as per the recommendation of several SEO persons. Apparently, since search engines don't read... -
cfform javascript change action
I am in the process off convertir all my form to cfform and here is my problem : <cfselect name="abc" onChange="document.form1.action='abc.cfm';... -
CFMX7 flash format CFFORM and Javascript
the getURL actionscript function worked for me. onclick=getURL('javascript:myfunction()')> -
noobie05 #2
Re: <CFFORM> halting Javascript?
For anyone querying this post, It was stopping it, by removing
<cfinclude> and using a CFFORM on the table as a whole corrected my
error! Have a Nice Day!
noobie05 Guest



Reply With Quote

