Re: Netscape onclick event

by "Rob Taylor" <rob(at)tconsult.com>

 Date:  Tue, 29 May 2001 20:52:47 -0400
 To:  "Derek Lavine" <derek(at)realware.com.au>,
<hwg-languages(at)hwg.org>
 References:  p ci241455a com
  todo: View Thread, Original
Hi Derek

Netscape claims there is no such thing as an "onClick" event
in certain situations such as Select Menus.  If the page reloads
on the click then try the onChange and you should be fine in both.

If not you will need to modify your scripts for each browser.  Because,
and correct me if I am wrong, but IE does not handle onChange like
Netscape handles onChange.  I think Netscape will continue to work
when "re-clicking" highlighted options where IE will not perform an
action until the selection absolutely changes.

In any event, that is why you are having troubles.  Hopefully onChange will
get you rolling the first time.


Rob
----- Original Message -----
From: "Derek Lavine" <derek(at)realware.com.au>
To: <hwg-languages(at)hwg.org>
Sent: Tuesday, May 29, 2001 7:47 PM
Subject: Netscape onclick event


> Hi all,
>
> I have a simple form with some javascript and it all works fine in IE but
> Netscape is playing up (or perhaps it is me) anyway the problem with NS is
> that the formActionSet method is not being called when I click either the
> guest or login graphic on the form. Is there a way I can get this to work,
> or is there another approach that will work for both these browsers (and
> others)
>
> Thanks very much
> Derek
>
> P.S. I know that formActionSet() is not being called in NS as I put an
> alert("message") in that function and it did not appear.
>
>
>
> <script language="JavaScript">
>
> <!--
> function submitForm() {
>         if (document.login.action == "../login/login_cmd.cfm"){
>                 if (document.login.f_userName.value == "") {
>                         alert("Please enter your user name");
>                         document.login.f_userName.focus();
>                         return false;
>                 }
>                 if (document.login.f_password.value == "") {
>                         alert("Please enter your password");
>                         document.login.f_password.focus();
>                         return false;
>                 }
>         }
>         return true;
> }
>
> function formActionSet(obj) {
>         if (obj.name == "login"){
>                 document.login.action = "../login/login_cmd.cfm";
>         }
>         else {
>                 document.login.action =
> "../site_selection/main_selection.cfm?a_guest=1";
>         }
>         return true;
> }
>
> -->
> </script>
>
>
> <FORM NAME="login" ACTION="login_cmd.cfm" METHOD=POST onSubmit="return
> checklogin(this)">
> <input type="Text" name="f_userName" required="No" size="12">
> <input type="password" name="f_password" style="" required="No" size="12">
> <input type="image" name="login" src="login.gif"
> onclick="formActionSet(this)">&nbsp;
> <input type="image" name="guest" src="guest.gif"
> onclick="formActionSet(this)">
> </FORM>
>
>
>
>
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA