Mark Stosberg wrote:
>Hello,
>
>I'm stuck on using some JavaScript to change the runmode. Any feedback
>is appreciated.
>
>This works in Mac NN 4.7.8, but not Mac IE 5. In my headers, I have this:
>
><script language="JavaScript" type="text/javascript">
> <!-- hide script from old browsers
> function update_distributor () {
> alert("I'm here!");
> // eventually I'll set the run mode here
> // but for now I'll call alert() for testing
> }
> // end hiding contents -->
></script>
>
>
>Later in a form I do:
>
><input type="submit" onclick="update_distributor()" value="Update"><BR>
>
>But I don't get the Alert box popup. What's going on?
>
onClick handlers on Submit objects are not guaranteed to be executed by the
javascript interpreter. what you need is an (1)onSubmit in the form or
(2) change
the input type above to be a button and force a submit via JavaScript.
(1)
<form name="theForm" onSubmit="return update_distributor()">
....
<input type="submit" value="Update"><BR>
.....
you should add the 'return' before the update_distributor call if you
wish this
function to return false and stop submission of the form.
(2)
<input type="button" onclick="update_distributor()" value="Update"><BR>
....
then in update_distributor()...
function update_distributor() {
....
document.forms['theForm'].submit(); // at the end when you want to
submit the form
}
--
Marcos Koopmanana [EMAIL PROTECTED] 858-546-1182 ext 318
WebSideStory 10182 Telesis Ct San Diego CA 92121
11 1/2 trips left - miles to date: 965.3, miles left: 453.1
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]