469,343 Members | 5,316 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

Form submit from A tag with Netscape

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!
Jul 20 '05 #1
5 1599
Ig**********@yahoo.com (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 - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
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?

Jul 20 '05 #3
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!
Jul 20 '05 #4
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!
Jul 20 '05 #5
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 <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_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-deve...upgrade_2.html
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Marc | last post: by
2 posts views Thread by Alexander Ross | last post: by
7 posts views Thread by greg brant | last post: by
1 post views Thread by Display Name | last post: by
14 posts views Thread by Chris | last post: by
4 posts views Thread by Yashwant | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.