I am trying to validate records based on the onclick event of a Checkbox or change event of a select option, for some reason this is not working in a cfwindow.
This is my form. can some please tell me what I did wrong here. The javascript is not even being called in a CFWINDOW.
<input type="checkbox" name="ccSameddress" value="shipsame" onclick="return sameinfo();">and below is my script:
<script language="JavaScript">
function sameinfo()
{
var d = document.cbfoundation;
if (d.chkSameddress.checked==true)
{
d.shipFName.value=d.bccFname.value;
d.shipLName.value=d.bccLname.value;
d.shipAddr1.value=d.bccAddr.value;
}
if (d.chkSameddress.checked==false){
d.shipFName.disabled=false;
d.shipLName.disabled=false;
d.shipAddr1.disabled=false;
}
}
</script>
Troubleshooting js is tedious. The way I do it is by using window.alerts to show the value of the variables that matter. Also, before concluding that the javascript is not being called at all, I suggest
window.alert("blah");
as the first line of your function. Then you'll know if the function was called.
It may or may not matter, but I always have return statements in my functions.
Problem solved.
I had to create a blank page and called the CFWINDOW page as an IFRAME, and now the validation is workinng.
There has to be a bug with the way CFWINDOW handles some events. I also noticed you can not upload a file in CFWINDOW.
I hope Adobe is aware of these little quacks with CFWINDOW
North America
Europe, Middle East and Africa
Asia Pacific