473,503 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1702
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7760
by: Marc | last post by:
Hello, I have a self - submitting form with multiple submits and I want to detect after the submit which button is pressed. Code example: <form name="example" method="post"...
2
5312
by: Alexander Ross | last post by:
I know that <a href="javascript:document.formname.submit();"> works for this, but can you use a hyperlink to submit a form WITHOUT assigning the form tags name attribute a value. The site I am...
13
40624
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
7
2967
by: greg brant | last post by:
i have a form made up of 2 file inputs and a submit button.. the imputs are to upload images, namley jpeg's for a e-greatings thing im working on. this only works with jpegs so i have a script...
1
3747
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your...
7
4860
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
14
14108
by: Chris | last post by:
Heres my problem: <a href="javascript:void(document.buysell.submit())" target="_parent" onMouseOver="MM_swapImage('members','','images/membersf2.gif',1)" onMouseOut="MM_swapImgRestore()"><img...
4
3294
by: Yashwant | last post by:
Dear Netscape/Javascript/Java gurus, I am trying to submit a form onUnLoad when the user accidentally closes the browser before clicking on a link to complete the transaction. On IE, this...
2
1636
by: lmeng | last post by:
Hi, I am new to this Forum. Thanks in advance for any kind help. In the following HTML code, when I change the value of one text field then click "Modify" button, if the validation fails a...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.