Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: Re: onClick madness - August 14, 1998 at 09:58:08

You are here: irt.org | BBS | Re: onClick madness [This BBS is closed]

Posted by Jason Nugent on August 14, 1998 at 09:58:08:

In Reply to: onClick madness posted by Dan Smith on August 14, 1998 at 08:53:41:

: I really hope you good people can help me.

: I am developing a customer order form. At points during the form I want to put help links. I came up with a neat info.gif button which, when you click on it, opens a little help window as follows:-

: <IMG SRC="info.gif" onClick="window.open ('help01.htm', 'new_window', 'toolbar=no,directories=no,menubar=no,status=no,resizable=no,scrollbars=no,width=300,height=200')">

: It works an absolute treat in MSIE4. In Netscape 4 squat happens (I would maybe have accepted the reverse and given up).

: I can't use the <FORM><INPUT TYPE="image" .... route because I'm already in a form (ie it opens the new window but it also tries to submit the form, causes all sorts of a problems).

: I've really wasted quite a lot of time on this but it looks so good when it works in MSIE4 that I'd really like to sort it out!

: Sorry I can't direct you to the page itself but it's stuck on an intranet...

: Cheers,

: -Dan-

Two things to try, and I'll mention pros and cons of each.:

make the IMG actually a link.
where openWin () is a function that will open your window. I've used this in both IE and NN and it works great. Cons - well, you have to make your image a link, if that is a problem. Set the border to 0 and no one will ever know :)
some browsers do not support javascript: urls. Of course, on an intranet you have a bit more control over what your population uses.

#2) use the FORM tag (I know, you mentioned that you can't, but this is a bit different):

<FORM>
<INPUT TYPE="image" SRC="yada yada" onClick="put your onClick stuff here">
</FORM>

pros: functionally equivalent to your method, since the image isn't actually a link tag.
cons: well, you mentioned you couldn't/didn't want to use a form. Other con - it might not work in NN, since you are back to using a image onClick event.
Personally, I think your best bet (and one that will work) is to try the first method. Use an anchor, and go from there.

Jason
Follow-ups:

You are here: irt.org | BBS | Re: onClick madness [This BBS is closed]

©2018 Martin Webb