![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
| /td |
| /td |
| /td |
#2
| |||
| |||
|
|
I have "coded values" in the value attribute of my radio button group which I can access easily. I'd like to be able to access in Javascript the more descriptive strings I have for each radio button. Is there a way to extend the script snippet below to access the description of the checked radio button? div class="genericinputLeft" * * <table * * * * <tr * * * * * * <td input class="transradio" type="radio" name="optDataSource" value="P" * * onclick="storeDataSource()" />Conventional (Purchase only)<br / input class="transradio" type="radio" name="optDataSource" value="R" * * onclick="storeDataSource()" />Conventional (Refinance only)<br / input class="transradio" type="radio" name="optDataSource" value="B" * * onclick="storeDataSource()" />Conventional (Purchase and Refi)<br / * * * * * * </td * * * * * * <td |
#3
| |||
| |||
|
|
On Jan 3, 3:58*pm, JJA <johnadam... (AT) gmail (DOT) com> wrote: I have "coded values" in the value attribute of my radio button group which I can access easily. I'd like to be able to access in Javascript the more descriptive strings I have for each radio button. Is there a way to extend the script snippet below to access the description of the checked radio button? div class="genericinputLeft" * * <table * * * * <tr * * * * * * <td input class="transradio" type="radio" name="optDataSource" value="P" * * onclick="storeDataSource()" />Conventional (Purchase only)<br / input class="transradio" type="radio" name="optDataSource" value="R" * * onclick="storeDataSource()" />Conventional (Refinance only)<br/ input class="transradio" type="radio" name="optDataSource" value="B" * * onclick="storeDataSource()" />Conventional (Purchase and Refi)<br / * * * * * * </td * * * * * * <td Part of the problem here is the "<input />", leaving us without the innerHTML option, |
#4
| |||
| |||
|
|
I have "coded values" in the value attribute of my radio button group which I can access easily. I'd like to be able to access in Javascript the more descriptive strings I have for each radio button. Is there a way to extend the script snippet below to access the description of the checked radio button? div class="genericinputLeft" table tr td input class="transradio" type="radio" name="optDataSource" value="P" onclick="storeDataSource()" />Conventional (Purchase only)<br / |
#5
| |||
| |||
|
|
On Jan 4, 8:31*am, Doug Gunnoe <douggun... (AT) gmail (DOT) com> wrote: On Jan 3, 3:58*pm, JJA <johnadam... (AT) gmail (DOT) com> wrote: I have "coded values" in the value attribute of my radio button group which I can access easily. I'd like to be able to access in Javascript the more descriptive strings I have for each radio button. Is there a way to extend the script snippet below to access the description of the checked radio button? div class="genericinputLeft" * * <table * * * * <tr * * * * * * <td input class="transradio" type="radio" name="optDataSource" value="P" * * onclick="storeDataSource()" />Conventional (Purchase only)<br / input class="transradio" type="radio" name="optDataSource" value="R" * * onclick="storeDataSource()" />Conventional (Refinance only)<br / input class="transradio" type="radio" name="optDataSource" value="B" * * onclick="storeDataSource()" />Conventional (Purchase and Refi)<br / * * * * * * </td * * * * * * <td Part of the problem here is the "<input />", leaving us without the innerHTML option, "The innerHTML option" is not viable by itself anyway, it is an IE proprietary property that has been copied by some, but not all, browsers. *The W3C equivalent (supported by Firefox at least) is textContent: |
#6
| |||
| |||
|
|
JJA wrote: I have "coded values" in the value attribute of my radio button group which I can access easily. I'd like to be able to access in Javascript the more descriptive strings I have for each radio button. Is there a way to extend the script snippet below to access the description of the checked radio button? div class="genericinputLeft" * * <table * * * * <tr * * * * * * <td input class="transradio" type="radio" name="optDataSource" value="P" * * onclick="storeDataSource()" />Conventional (Purchase only)<br / Don't use XHTML markup unless you really are serving XHTML as XML, use HTML 4.01 Strict. The best method is to put the radio buttons inside label elements. This has the benefit of making it easy to identify the text you want and also increases the clickable area of the button, making it easier to select them. *It also means users can click the actual text to select it, rather than the adjacent button. The downside is that you have to add ID attributes to the buttons[1]. |
![]() |
| Thread Tools | |
| Display Modes | |
| |