On 06/07/2005 17:24, realraven2000 (AT) hotmail (DOT) com wrote:
[snip]
Quote:
script language="JavaScript" type="text/JavaScript"
!-- |
Drop the language attribute and the SGML comments.
[snip]
Quote:
alert("checked=" + document.frmProdDet("checkbox" + ncount).checked); |
A form object is not a function, so calling it will only cause an error.
Use square brackets:
alert('checked=' + document.frmProdDet['checkbox' + ncount].checked);
The same applies later. However, you can go one step further by using
the forms and elements collections, as well as saving a reference to the
form, rather than resolving it more than once:
function chkbuy(ncount) {
var elements = document.forms.frmProdDet.elements;
if(elements['checkbox' + ncount].checked) {
elements['txtQty' + ncount].value = '1';
} else {
elements['txtQty' + ncount].value = '';
}
}
or even better (variables truncated to avoid wrapping):
function chkbuy(n) {
var e = document.forms.frmProdDet.elements;
e['txtQty' + n].value = e['checkbox' + n].checked
? '1'
: '';
}
[snip]
Quote:
input type="checkbox" name="checkbox<%=ncount%>"
onclick=javascript:chkbuy(<%=ncount%>) |
That onclick attribute must be quoted. You can also drop the javascript
:
prefix unless you're using client-side VBScript elsewhere (in which
case, compatibility with Firefox is rather pointless

.
Hope that helps,
Mike
--
Michael Winter
Prefix subject with [News] before replying by e-mail.