Z
zig
I've posted this on alt.comp.lang.coldfusion, but is predominantly a
javascript problem:
I have a CF query which returns several rows of records. I wanted to
have a checkbox on each record of that returned query which would
allow the user to select which record to print if checked.
As the checkboxes are generated within the CF, they all have tha same
name. With the help of a fellow a.c.l.c. member, we've got the script
to a point where it will define whether 1 box is checked or not, only
when there are more than 1, I receive the error: 'f.length is null or
not an object'.
Here's the script as it is now. Any help greatly appreciated:
<script language="JavaScript">
function win(){
var s = '';
f = document.boxs;
for (var i=0;i < f.length;i++){
if (f.elements.name == 'printprop' && f.elements.checked){
if (s.length != 0) s += ',';
s += f.elements.value;
}
} window.open("openprintR.cfm?ID=" +
s,"","height=600,width=600,left=0,top=0")
}
</script>
<body>
<a href="javascript:win()">print report</a>
<cfoutput query="myquery">
<form name="boxs" action="javascript:win()" method="post">print this
property <input type="checkbox" name="printprop"
value=#ID#></form>
</cfoutput>
Steve.
javascript problem:
I have a CF query which returns several rows of records. I wanted to
have a checkbox on each record of that returned query which would
allow the user to select which record to print if checked.
As the checkboxes are generated within the CF, they all have tha same
name. With the help of a fellow a.c.l.c. member, we've got the script
to a point where it will define whether 1 box is checked or not, only
when there are more than 1, I receive the error: 'f.length is null or
not an object'.
Here's the script as it is now. Any help greatly appreciated:
<script language="JavaScript">
function win(){
var s = '';
f = document.boxs;
for (var i=0;i < f.length;i++){
if (f.elements.name == 'printprop' && f.elements.checked){
if (s.length != 0) s += ',';
s += f.elements.value;
}
} window.open("openprintR.cfm?ID=" +
s,"","height=600,width=600,left=0,top=0")
}
</script>
<body>
<a href="javascript:win()">print report</a>
<cfoutput query="myquery">
<form name="boxs" action="javascript:win()" method="post">print this
property <input type="checkbox" name="printprop"
value=#ID#></form>
</cfoutput>
Steve.