hello all, could really use a point in the right direction here PLEASE:
am showing or hiding a field in form depending upon a value in another field. this code works great, EXCEPT for first time through script.
<script type=“text/javascript”>
function writebox(form) {
if (form.repeat.value==‘0’) {
document.getElementById(“dDateE”).style.visibility = “hidden”;
} else {
document.getElementById(“dDateE”).style.visibility = “visible”;
}
}
so in addition I added this bit for onload, but it does not seem to be working, but how can it not be working? I mean it’s identical right?
window.onload = function writebox(form) {
if (form.repeat.value==‘0’) {
document.getElementById(“dDateE”).style.visibility = “hidden”;
} else {
document.getElementById(“dDateE”).style.visibility = “visible”;
}
}
the first function is on top of page and that onload bit is down in a part of the script I know is executed first time through.
I’m a newbie and lost and would really just a push in the right direction here!
many thanks,
mike