Your problem is that you can not use with() in this context (in reality it should of thrown you an error) as it is only used to set the properites of an object. For example:
Code:
with(someElement.style)
{
color = "black";
}
The following JavaScript will suit your needs:
Code:
<script language="JavaScript">
function ckbox(y){
//with(document.form_product){
if(y=="1"){
document.getElementById('form_prodcode').value=''; document.getElementById('form_prodcode').disabled=true;
}else if(y=="0"){
document.getElementById('form_prodcode').disabled=false;
}
//}
}
</script>
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========