Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Link not working in IE

Reply
Thread Tools

Link not working in IE

 
 
Bruce A. Julseth
Guest
Posts: n/a
 
      03-21-2008
The following link works fine in Firefox but "Nothing" happens when I click
on the link in IE? Any idea why?

<a href="addNewPatient.php" target="_blank"><label>Add a new
patient</label></a>

Thanks..



 
Reply With Quote
 
 
 
 
mynameisnobodyodyssea@googlemail.com
Guest
Posts: n/a
 
      03-21-2008
On Mar 21, 7:23*pm, "Bruce A. Julseth" wrote:
> The following link works fine in Firefox but "Nothing" happens when I click
> on the link in IE? *Any idea why?
>
> <a href="addNewPatient.php" target="_blank"><label>Add a new
> patient</label></a>
>
> Thanks..


Remove the label tags, you can add if you want a title attribute to
the
<a> element.

Why did you use the label element inside the <a> tags?
 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      03-21-2008
Bruce A. Julseth wrote:
> The following link works fine in Firefox but "Nothing" happens when I click
> on the link in IE? Any idea why?
>
> <a href="addNewPatient.php" target="_blank"><label>Add a new
> patient</label></a>


Anyone's ability to help you relies entirely on whether the problem
happens to lie in the small fraction of your code that you've chosen to
show us.

As it happens, it's enough to see that you've used a LABEL tag without
any indication of what it's supposed to be a label for. What was your
intention in using it?

http://www.w3.org/TR/html4/interact/forms.html#h-17.9

I'm guessing that given the choice between having your click passed on
to the handler for labels and the handler for hyperlinks, IE is choosing
to pass it on to the handler for labels. If your label were tied to a
control as it's designed to be, your click would activate or pass focus
to the control. Since there is no associated control, nothing happens at
all.
 
Reply With Quote
 
Bruce A. Julseth
Guest
Posts: n/a
 
      03-21-2008
Both responses, asked how I was using the label. Here is an explaination.

On the original form, I have a comboBox that loads a list of names. If the
user doesn't find the person they are looking for in the comboBox, they
click on this label to load a form "addNewPatient.php". This dialog, adds
the "new patient" to the data base, then re-calls the original form, with
the original comboBox loaded with this new person.

How would you do what I am trying to do?

All of this works fine in FireFox, but "Nothing" happens in IE. I removed
the <label> tag and it now works in IE.

Thanks..

"Bruce A. Julseth" <> wrote in message
news:RWTEj.25015$.. .
> The following link works fine in Firefox but "Nothing" happens when I
> click
> on the link in IE? Any idea why?
>
> <a href="addNewPatient.php" target="_blank"><label>Add a new
> patient</label></a>
>
> Thanks..
>
>
>



 
Reply With Quote
 
mynameisnobodyodyssea@googlemail.com
Guest
Posts: n/a
 
      03-21-2008
On Mar 21, 8:08*pm, "Bruce A. Julseth" wrote:
> How would you do what I am trying to do?


Try with the <a> element inside the <label> element, like
<label><a href="...">something</a></label>

Usually the <label> element is associated with form controls,
not with links.

I quote from the HTML 4 spec about label
To associate a label with another control implicitly,
the control element must be within the contents of the LABEL element.
In this case, the LABEL may only contain one control element.

see
http://www.w3.org/TR/REC-html40/inte...tml#edef-LABEL
 
Reply With Quote
 
Bruce A. Julseth
Guest
Posts: n/a
 
      03-21-2008
Yes, wrapping the "<a>" tag with the <label> tag also works.

Thanks...

<> wrote in message
news:6747e027-cb75-4185-b07d-...
On Mar 21, 8:08 pm, "Bruce A. Julseth" wrote:
> How would you do what I am trying to do?


Try with the <a> element inside the <label> element, like
<label><a href="...">something</a></label>

Usually the <label> element is associated with form controls,
not with links.

I quote from the HTML 4 spec about label
To associate a label with another control implicitly,
the control element must be within the contents of the LABEL element.
In this case, the LABEL may only contain one control element.

see
http://www.w3.org/TR/REC-html40/inte...tml#edef-LABEL


 
Reply With Quote
 
Michael Fesser
Guest
Posts: n/a
 
      03-21-2008
..oO(Bruce A. Julseth)

>Yes, wrapping the "<a>" tag with the <label> tag also works.


Doesn't make it right. No form control, no label.

Micha
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-21-2008
Scripsit Harlan Messinger:

>> <a href="addNewPatient.php" target="_blank"><label>Add a new
>> patient</label></a>

>
> Anyone's ability to help you relies entirely on whether the problem
> happens to lie in the small fraction of your code that you've chosen
> to show us.


Not entirely. It also depends on the current state of anyone's crystal
ball and mind.

> As it happens, it's enough to see that you've used a LABEL tag without
> any indication of what it's supposed to be a label for.


It's also enough for seeing an interesting technical problem, though
it's not that interesting _pragmatically_. The problem vanishes in a
puff of logic, when the redundant <label> markup is removed (or <a> and
<label> are nested the other way around).

Still, we have a genuine browser bug here. No matter what sense <label>
might or might make inside <a>, it's valid and does not change the
defined meaning of <a>.

> What was your intention in using it?


An interesting question as such. Here's a case where it would make
sense:

<input type="checkbox" ... id="compr">
<a href="compr.html" title="Explanation of data compression applied">
<label for="id">Compressed</label></a>

That is, a normal combination of a field and its label, but with the
label turned into a link to a document that explains what the choice
means.

Of course, now that we know the bug, we can avoid it by nesting the
elements differently or using a different construct.

> I'm guessing that given the choice between having your click passed on
> to the handler for labels and the handler for hyperlinks, IE is
> choosing to pass it on to the handler for labels.


Sounds plausible. Interesting enough, IE (7) lets me focus on the text
in the label (when using <a ...><label>...</label></a>), showing the
focus rectangle. It also lets me activate something by hitting Enter,
but then weird things happen. So this inaccessible in an exceptional
sense: you can work with the keyboard, but not with the mouse: normal
clicking does not work.

Or _can_ you...? Yes, you can right click on the text and open the link
via the menu.

So here we have a partial answer to the question (asked somewhere
recently) "how do I make a link non-clickable?"

> If your label were
> tied to a control as it's designed to be, your click would activate
> or pass focus to the control. Since there is no associated control,
> nothing happens at all.


I actually tried to use the construct so that the label is tied to a
control, and the control is indeed activated when the label is clicked.
E.g., if the control is a checkbox, its state is toggled.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
GTalbot
Guest
Posts: n/a
 
      03-23-2008
On 21 mar, 17:05, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:

> Still, we have a genuine browser bug here. No matter what sense <label>
> might or might make inside <a>, it's valid and does not change the
> defined meaning of <a>.


Correct. This weird-looking <label> inside an <a> code may be a
variation (or a "cousin") of other label bugs:

http://www.gtalbot.org/BrowserBugsSe...E7Bugs/#bug118

http://www.gtalbot.org/BrowserBugsSe...WithImage.html

happens in both IE 7 and IE 8 beta 1


> > What was your intention in using it?

>
> An interesting question as such. Here's a case where it would make
> sense:
>
> <input type="checkbox" ... id="compr">
> <a href="compr.html" title="Explanation of data compression applied">
> <label for="id">Compressed</label></a>


Jukka, did you mean to code
<label for="compr">
rather? ... pretty sure that's what you meant to do there...

Regards, Gérard
--
Internet Explorer 8 bugs
http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-23-2008
Scripsit GTalbot:

>> <input type="checkbox" ... id="compr">
>> <a href="compr.html" title="Explanation of data compression applied">
>> <label for="id">Compressed</label></a>

>
> Jukka, did you mean to code
> <label for="compr">
> rather? ... pretty sure that's what you meant to do there...


Yes, surely. The <label> element is supposed to associate with the
<input> element here. I was probably thinking "the 'for' attribute needs
to contain the value of the 'id' attribute of the element it refers to",
and then my brain took the wrong path....

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect to link nr 2 if link nr 1 is not working. kolesdz HTML 9 08-22-2007 03:54 AM
os.link makes a copy, not a link Dan M Python 5 06-10-2006 10:00 AM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM



Advertisments