472,985 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,985 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 22268


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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.