<CFFORM> halting Javascript?

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default <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">&nbsp;</td>
    <td><input name="CalcOutput" type="text" value="0"
    size="7"/></td>
    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </form>
    </table>

    noobie05 Guest

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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';...
    5. CFMX7 flash format CFFORM and Javascript
      the getURL actionscript function worked for me. onclick=getURL('javascript:myfunction()')>
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139