Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts

    gripe and question about form controls

    The gripe first

    How come when checkbox arrays and radio groups are only have one control they act as a single object and not an array with a length of one? I mean, I know why it's done, but I just don't think it SHOULD be that way. Having them ALWAYS be arrays to the DOM would be so much nicer.

    Now the question

    Anyone know how checkbox arrays and radio groups will function once XHTML abandons the name attribute? Since ids must be unique, what will link them together creating the array/group?

    P.S. These are mostly thoughts outloud, and I realize the answer may be a google-search away, I just wanted to voice them here
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: gripe and question about form controls

    Originally posted by beetle
    Anyone know how checkbox arrays and radio groups will function once XHTML abandons the name attribute? Since ids must be unique, what will link them together creating the array/group?

    Custom attributes Which of course wouldn't be compliant ... so you may as well keep using NAME. I'm not sure how it works from that perspective - the ability to arbitrarily create and use attributes is incredibly useful; methinks XHTML, being extensible, would have a mechanism by which this could be deemed valid?

  • #3
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    http://lists.w3.org/Archives/Public/...nMar/0087.html

    according to this, the name attribute had been deprecated for everything but form elements. that was probably an after-thought, after they realized "hey, wait a second, we NEED that!"

    as far as the arrays are concerned, the only element that applies to, is the checkbox, because with a radio-button, there should never really be less than 2 of them (some people might argue 3, and technically, that's true, but there are some cases where an on-off switch is not as intuitive as two radio-buttons. no, i can't think of any right now. ). and i agree; it probably ought to be an array of length == 1, but it's not. blame netscape.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks joh6nn. I agree with you on the 1-radio-button-thing. However, in a site I'm working on now run into occurances where because of dynamically generated data, I may have only 1 checkbox in the array. I had to modify some JS code to handle this. Grrrrr.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have found this annoying at times too. I always just end up checking the length of the element.

    And as John says, the name attribute is only deprecated for the form tag itself, not the individual form elements.

    That's still kind of a pain since I have to kind of rewrite some of my scripts to pass stuff into functions like (this) or (this.form) since you can't use document.FORMNAME.whatever anymore, but if anything they usually end up being more elegant because of that. (Not that I'm a javascript guru quite yet. )
    Last edited by whammy; 11-17-2002 at 12:56 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •