Forum Moderators: open
If you want the javascript to execute first you could make an HTML file with no actual content apart from loading the javascript and then have the javascript to do what it should do and then load the actual page content.
The function was called onload of the body in a format <body onLoad="myfunction();">. I changed it as follows:
I moved the event to the form on (onfocus event) of one of the select boxes.
I put a hidden box to control if the box is already loaded, as it might load again when it gets the focus. The code:
<script language="javascript" type="text/javascript">
function null_load_value() {
document.main.load_value.value = 0;
}
</script>
<script language = "JavaScript" type="text/JavaScript">
function load_once() {
if (document.main.load_value.value == 1) {
document.main.load_value.value = 1;
}
else {
myfunction();document.main.load_value.value = 1;
}
}
</script>
and it works very well. :)
Tnx,
Hab