473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

URL link using Button not working in IE

I would like to use a Form "button" (or "input", either one) within an
anchor, instead of using text or creating a graphic. This works fine
in all browsers but IE, but IE, while showing the correct URL in the
status line and the tooltip, DOESN'T initiate the link.

The code is essentially:

<a href="http://foo.com/whatever.htm">
<input type="button" value="Click Me"></a>

Works fine in Mozilla, Opera, etc., but not in IE. Any ideas?

Don

Jul 24 '05 #1
7 22292


ra***@alum.mit.edu wrote:

I would like to use a Form "button" (or "input", either one) within an
anchor, instead of using text or creating a graphic. The code is essentially:

<a href="http://foo.com/whatever.htm">
<input type="button" value="Click Me"></a>


<form action="http://foo.com/whatever.htm">
<input type="submit" value="Click Me">
</form>

Thor

--
http://www.anta.net/OH2GDF
Jul 24 '05 #2
<input type="button"
onclick="window.location='http://www.google.com/'">

break frames
<input type="button"
onclick="top.window.location='http://www.google.com/'">

new window
<input type="button" onclick="window.open('http://www.google.com/')">

Jul 24 '05 #3
doing it that way will put a "?" on the end of the url when you arrive
at the page. best to use the javascript way to avoid it.

<input type="button" onclick="window.location='http://www.google.com/'">

Jul 24 '05 #4
in comp.infosystems.www.authoring.html, dw************@gmail.com wrote:
doing it that way will put a "?" on the end of the url when you arrive
at the page. best to use the javascript way to avoid it.
What exactly does it hurt?
<input type="button" onclick="window.location='http://www.google.com/'">


And if user has JS disabled?
This

<form action="http://example.com/">
<input type="submit" value="Click Me"
onclick="window.location='http://example.com/';return false;">
</form>

is only little better. You need to check if windows.location is allowed.
I don't know how.

Anyway, making link look like button is stupid:
http://www.cs.tut.fi/~jkorpela/www/links.html#forms
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 24 '05 #5
On 8 Jun 2005 15:02:58 -0700, dw************@gmail.com wrote:
doing it that way will put a "?" on the end of the url
So what?
when you arrive at the page.
Where you eventually arrive depends on what the server wants to do.
best to use the javascript way to avoid it.


Wrong.
Jul 24 '05 #6

<ra***@alum.mit.edu> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I would like to use a Form "button" (or "input", either one) within an
anchor, instead of using text or creating a graphic. This works fine
in all browsers but IE, but IE, while showing the correct URL in the
status line and the tooltip, DOESN'T initiate the link.

The code is essentially:

<a href="http://foo.com/whatever.htm">
<input type="button" value="Click Me"></a>

Works fine in Mozilla, Opera, etc., but not in IE. Any ideas?

Don


In answering the actual question you put, rather than questions you didn't
put, my suggestion is this:

Briefly, in the IE event model, events bubble upwards through the document
hierarchy. They are first received by the element upon which the event
occurred. If not handled, they bubble up through the hierarchy until they
are. There are ways to modify this behaviour.
In your code, the button is at the bottom of this branch of the hierarchy.
It recieves the click event, and being a button, handles it. The event does
not proceed up the chain to the anchor element; the link is not activated. A
button handles click events automatically, though, until an event-handler is
explicitly provided to it, does nothing with it.

NOW it is appropriate to ask why you are bothering to do it this way. As the
other posts suggest, use a button or a link. There is no need for both.
HTML-only solutions avoid the pitfalls of disabled script in client.

Laurence
Jul 24 '05 #7
Lauri Raittila wrote:
[Somebody wrote:]

a "?" on the end of the url


What exactly does it hurt?


Tacking a lone '?' to the end of a path creates a new URI
which by STD66 isn't equivalent to the '?'-less one, though
it could still be equivalent in the sense that it identifies
the same resource.

So, for one, there's (potential) caching implications here,
because the controller now has two addresses published that
point to the same location.

Cheers,

--
Jock

Jul 24 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: J | last post by:
Hi All, I have a quick question, I am making a little script that shows users how easy it is to have there clipboards read. I would like to capture my users clipboard (plain text only) and then...
0
by: JFF | last post by:
Hello I would like to transmit commands from a Data Access Page to my access database. The user see a link or button in his HTML page ; he clics and the result should be to transmit to the Access...
3
by: Srik | last post by:
I am working on a project where in we have a requirement in which we need to open a new window on click of a link and also I should display a link in the new opened window after the data is...
2
by: BASSPU03 | last post by:
I used the Common Dialog API to store file paths on my form's underlying table. These paths are displayed in a textbox that I can click to open the selected file. Having stored the file paths in...
2
by: rameshgohil | last post by:
I am using grid view and a button column in it using <itemTemplate> but I am not able to rerive cell value of a selected row from grid view. I have tried the following to methods in Row_command...
7
by: ykhamitkar | last post by:
Hi there, I have a form where I want to add new row using button and done want a default new record, I have changed "Allow Additions" to No for the forms properties and have added following...
2
by: gurbaksh08 | last post by:
how to link flash button in asp.net so kindly send the procedure of this as soon
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.