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

BBS: Re: onClick madness - August 18, 1998 at 11:13:23

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

Posted by Rob Friesel on August 18, 1998 at 11:13:23:

In Reply to: Re: onClick madness posted by Dan on August 15, 1998 at 19:51:06:

: : : 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
: In Netscape:
: The onclick () event handler doesnt work within the : The image needs to be within a hyperlink.

Instead of onClick, try onMouseDown or onMouseUp ... both event handlers work with the image object and work the same way as onClick (in fact, both events put together make onClick so...) I was experiencing a similar problem with a photo gallery I was developing for my personal homepage.

If you still can't get it to work, have a peek at that photo gallery ( http://www.smcm.edu/users/refriesel/gallery.htm ). If it works the way you're trying to get that gif button to work, just drop me an email request for the core source code of the .js file and I'll blitz it back to you.

---rob
Follow-ups:

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

©2018 Martin Webb