SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Pointiest Petitions carrotflowers's Avatar
    Join Date
    Jul 2003
    Location
    Suburbs of DC (MD)
    Posts
    595
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    netscape 4 form handling error?

    Hi I can't post the code at the moment, but I am having trouble with the javascript event handling on a form I made. The events are tied to buttons with images as their source. Actually I don't think that's relevant, but my question is this: does anyone know if leaving the name part blank (as in <input src="image.gif" type="image" name="" onclick="somevent;">) will cause an error in Netsape 4?

    Thanks.

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's a form submission button. Need to see more of your code. Would appreciate you ignoring that 'browser'.

    Type 'mocha' into the location field & hit 'enter' to see the error message.
    ::: certified wild guess :::

  3. #3
    Pointiest Petitions carrotflowers's Avatar
    Join Date
    Jul 2003
    Location
    Suburbs of DC (MD)
    Posts
    595
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I would appreciate my ignoring that (cough cough) 'browser' too, but unfortunately, I cannot.

    The line is basically:
    <input type="image" name="" src="button.gif" onclick="document.form='formname'; return confirm('ok to proceed?');" alt="Delete">

    As you see I didn't put in a name. I was just wondering if there was a some Netscape 4 bug that required it. I'm not getting my confirm alert.

    Thanks I'll look into the mocha.

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aah. You said 'will cause an error'....just because something isn't implemented (is unsupported) in a particular browser doesn't signify an error as such. Netscape 4 Image objects have event handlers, but they're not parsed in HTML. In other words, they must be assigned in JavaScript (told you to ignore it). Try this:
    Code:
    <input type="image" name="" src="button.gif" onload="this.onmouseup=function(){return confirm('ok to proceed?')}" alt="Delete">
    Don't have NS4 here ( ) but I think that's correct. It doesn't support Image.onclick, even in its DOM, so you need to use mouseup or mousedown. I have no idea if cancelling the mouseup event will stop submission of the form but, give it a shot. Left out the other business (document.form='formname') as I have no idea what it's doing.
    ::: certified wild guess :::


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •