House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Interesting Firefox behavior

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Vernon
08/29/2007 12:51 PM

----- Excess quoted text cut - see Original Post for more ----- Is that valid? Surely it should look more like this <form>   <label for="foo">Foo</label><input type="text".... id="foo" />   <label for="bar">Bar</label><input type="text".... id="bar" /> </form> If you don't need the "bar" label, then I'd simply leave it out... Paul

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bruce Sorge
08/29/2007 12:53 PM

I tested it in Netscape and Opera. It did it in Netscape but not Opera. Not sure what is causing it though. Bruce Here is some interesting behavior.   Give this code snippet a try in Firefox and see what happens when you try and click in the second text input box. <form>     <label>Public Telephone Number:         <span>             <input type="text" name ="foo" size = "3" maxlength = "3" value="" /> -             <input class="two" type="text" name ="bar" size = "8" maxlength= "8" value="" /> (if 916-, xxx-xxxx, otherwise, xxx-xxx-xxxx)         </span>     </label> </form> Did you also get the browser putting the focus in the first text box whenever you clicked on the second?  Is this documented anywhere?  Is it actually desirable.  I know our test user found it rather confusing.   Any other browser work like this?  I.E. 6 and 7 apparently do not.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ian Skinner
08/29/2007 02:06 PM

"I tested it in Netscape and Opera. It did it in Netscape but not Opera. Not sure what is causing it though." I suspect it is that the browsers that exhibit this behavior have more complete support for the label standard.  The standard says that if a label is tied to a control, clicking on the label should set the focus to the associated control.   With two controls to choose from these browsers are setting the focus to the first one. This may not necessarily be bad, but it is definitely something of which one should be aware.  I would be interested in documentation explaining the whys and wherefores of this behavior.  

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ian Skinner
08/29/2007 02:02 PM

"Is that valid? Surely it should look more like this" I don't know!  Is there something that says there should only be a one to one relationship with form controls and labels?  In this example it is a phone number, but we are providing an area code field and a number field.  From a display perspective only one label is required for the way we want to present it.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
John Cox
08/29/2007 02:13 PM

> "Is that valid? Surely it should look more like this" > > I don't know!  Is there something that says there should only be a one to > one relationship with form controls and labels?  In this example it is a > phone number, but we are providing an area code field and a number > field.  From a display perspective only one label is required for the way we > want to present it. It's not valid and it's performing as expected, IMO.  It's IE that is being too loose on the spec. http://www.w3.org/TR/html4/interact/forms.html#h-17.9.1 "Each  LABEL <http://www.w3.org/TR/html4/interact/forms.html#edef-LABEL>element is associated with exactly one form control." You could set the label id explicitly to "bar" if you used the id (see below). <form>    <label for="bar">Public Telephone Number:        <span>            <input type="text" name ="foo" size = "3" maxlength = "3" value="" /> -            <input class="two" type="text" id="bar" name ="bar" size = "8" - Hide quoted text - maxlength= "8" value="" /> (if 916-, xxx-xxxx, otherwise, xxx-xxx-xxxx)        </span>    </label> </form>

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Henderson
08/30/2007 11:17 PM

> > Here is some interesting behavior.   Give this code snippet a try in > > Firefox and see what happens when you try and click in the second text ----- Excess quoted text cut - see Original Post for more ----- "3" ----- Excess quoted text cut - see Original Post for more ----- xxx-xxx-xxxx) ----- Excess quoted text cut - see Original Post for more ----- Is it > > actually desirable.  I know our test user found it rather confusing. > > Any other browser work like this?  I.E. 6 and 7 apparently do not. > > Nope. But then I also added <label for="foo">. You need to associate the label with an input field or it WILL behave in a strange and unpredictable manner in some browsers. HTH Mark -- This message has been scanned for viruses and dangerous content by ISPNZ's automated virus detection system, and is believed to be clean.


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference