Variable CNT1 is undefined when using Javascript
Posted: 2011-01-21 19:43
Does anyone have any idea how to reference an ADDT field/form/Id on a Form?
- The ID for my first Text box is: inputtext (sees this one fine)
- The ID for my second text box is: wkRptOrdStaNts_<cfoutput>#cnt1#</cfoutput>
Javascript is unable to see the second text box ID/value because of all the extra variables in it i guess? (I get the error: Variable CNT1 is undefined)
Here is my Javascript code:
--------------------------
<script language="javascript" type="text/javascript">
function addtext() {
var newtext = document.getElementById('inputtext');
document.getElementById('wkRptOrdStaNts_<cfoutput>#cnt1#</cfoutput>') += newtext;
}
</script>
---------------------------
- The ID for my first Text box is: inputtext (sees this one fine)
- The ID for my second text box is: wkRptOrdStaNts_<cfoutput>#cnt1#</cfoutput>
Javascript is unable to see the second text box ID/value because of all the extra variables in it i guess? (I get the error: Variable CNT1 is undefined)
Here is my Javascript code:
--------------------------
<script language="javascript" type="text/javascript">
function addtext() {
var newtext = document.getElementById('inputtext');
document.getElementById('wkRptOrdStaNts_<cfoutput>#cnt1#</cfoutput>') += newtext;
}
</script>
---------------------------