Form submit from A tag with Netscape

Discussion in 'Javascript' started by Keith Bowes, Jan 12, 2004.

  1. Keith Bowes

    Keith Bowes Guest

    Lasse Reichstein Nielsen wrote:
    >
    >><form name="f1" method="post" action="TTT.htm">
    >>
    >><a href="javascript:document.f1.submit();">

    >
    >
    > <a href="whyThisPageRequiresJavascript.html"
    > onclick="document.forms['f1'].submit();return false;">
    > Test
    > </a>
    >


    Why not style the button with CSS, so that it will look like the typical
    visual representation of a link? Or, dynamically write the link and
    include a standard submit button in the "noscript" element?
     
    Keith Bowes, Jan 12, 2004
    #1
    1. Advertising

  2. Keith Bowes

    ddt_rock Guest

    Hello, everyone!

    I have a problem with Netscape.
    I want to submit form from <A> tag

    <form name="f1" method="post" action="TTT.htm">

    <a href="javascript:document.f1.submit();">
    Test
    </a>
    </form>

    This code works fine in IE, but Netscape just ignores it.

    WHo knows what is wrong with my code?

    Thanks!
     
    ddt_rock, Jan 12, 2004
    #2
    1. Advertising

  3. (ddt_rock) writes:

    > I have a problem with Netscape.


    You have a problem with your code running on Netscape :)
    Which Netscape, by the way?

    > I want to submit form from <A> tag


    Why? The submit button is made for just that, and the user will
    know what it means.

    > <form name="f1" method="post" action="TTT.htm">
    >
    > <a href="javascript:document.f1.submit();">


    <a href="whyThisPageRequiresJavascript.html"
    onclick="document.forms['f1'].submit();return false;">
    Test
    </a>

    > This code works fine in IE, but Netscape just ignores it.
    >
    > WHo knows what is wrong with my code?


    Probably the reference to the form. Try the more explicit version here.
    And don't use "javascript:"-URIs, the onclick attribute is much better.


    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Jan 12, 2004
    #3
  4. How can I define CSS for a button, so it will look as a simple link?



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Igor Mikhalyev, Jan 12, 2004
    #4
  5. I am using Netscape 4.78.

    And your code is not working on it :(

    I can not use buttons here because of the requirements I have :)

    Anyway, thanks! :)

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Igor Mikhalyev, Jan 12, 2004
    #5
  6. Keith Bowes

    Grant Wagner Guest

    Igor Mikhalyev wrote:

    > How can I define CSS for a button, so it will look as a simple link?


    If you want something that looks like a link to submit a form, I
    recommend something like:

    <style type="text/css">
    ..submitLink {
    background-color: transparent;
    border: 0px solid transparent;
    color: Blue;
    text-decoration: underline;
    cursor: pointer;
    cursor: hand;
    }
    ..submitLink:active {
    border: 0px solid transparent;
    color: Red;
    }
    }
    </style>
    <form>
    <input type="submit" name="submitBtn" value="Order" class="submitLink"
    />

    </form>

    Certainly it isn't as pretty in Netscape 4 or Opera 6, but it's
    guaranteed to give you a usable submit button regardless of the browser
    being used (presuming the browser supports form and form submission).

    By the way, Opera 7.23 is *still* having problems with this design. With
    7.23, it now honors border requests on buttons, but it honors neither
    the cursor: nor the text-decoration: directives. Also, Opera 7.23 seems
    to support the :active pseudo-class, at least partially, it makes a
    valiant attempt to honor the border: directive, but it fails to do it
    correctly.

    --
    | Grant Wagner <>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *
    http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

    * Internet Explorer DOM Reference available at:
    *
    http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 7 / Mozilla
    * http://www.mozilla.org/docs/web-developer/upgrade_2.html
     
    Grant Wagner, Jan 21, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yashwant
    Replies:
    3
    Views:
    2,656
    Michael Winter
    May 4, 2004
  2. shruds
    Replies:
    1
    Views:
    893
    John C. Bollinger
    Jan 27, 2006
  3. André
    Replies:
    2
    Views:
    773
    André
    Jun 23, 2008
  4. Eqbal Z
    Replies:
    6
    Views:
    197
    Eqbal Z
    Aug 27, 2003
  5. Replies:
    3
    Views:
    750
Loading...

Share This Page