Form submit from A tag with Netscape

K

Keith Bowes

Lasse said:
<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?
 
D

ddt_rock

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!
 
L

Lasse Reichstein Nielsen

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
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
 
I

Igor Mikhalyev

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! :)
 
G

Grant Wagner

Igor said:
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 <[email protected]>

* 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top