![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
IE might let you get away with that but IE doesn't have a clue what the difference between an ID and a NAME is. Firefox lets you get away with it, and so does Safari on Win. They treat it kjust like any other element with an ID. I've seen a lot of people "work around" radios this way, although I'm not a huge fan of it, it can definitely be done across the majors. They substitute the ID for a NAME attribute when using the forms collection? |
#12
| |||
| |||
|
|
The worst I've had to deal with is working with a form that had different types of inputs, all with the same name but with uniquely- identifying values. That is hell. |
#13
| |||
| |||
|
|
Matt Kruse said: [snip] The worst I've had to deal with is working with a form that had different types of inputs, all with the same name but with uniquely- identifying values. That is hell. I think this one wins the PITA award, Randy. |
#14
| |||
| |||
|
|
I have seen benefits to Radio Buttons, never seen a benefit to the scenario Matt is describing. I don't even use the benefits of name[] that PHP brings to you. Although just the prospects of it sounds like hell. |
#15
| |||
| |||
|
|
David Mark wrote on 03 jan 2008 in comp.lang.javascript: INPUT TYPE=RADIO NAME=Q VALUE=1 ID=Q1 INPUT TYPE=RADIO NAME=Q VALUE=2 ID=Q2 allowing the use of something like: document.form.Q1.checked. If it were this simple, then even I could manage it. You can do that. But you wouldn't want to. *Assuming a form with name "formName", the two elements' checked values should be referenced as: document.forms.formName.elements.Q[0].checked document.forms.formName.elements.Q[1].checked But only if the input/radios are/stay in the right order! |
|
If you, a year later, change the code to to INPUT TYPE=RADIO NAME=Q VALUE=2 ID=Q2> water<br INPUT TYPE=RADIO NAME=Q VALUE=1 ID=Q1> fire<br you could have a hell of debugging. |
![]() |
| Thread Tools | |
| Display Modes | |
| |