DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   Need some help with RADIO buttons forms (http://www.daniweb.com/forums/thread101814.html)

SergioQ Dec 19th, 2007 4:37 pm
Need some help with RADIO buttons forms
 
So am using Perl to dynamically generate a form with radio buttons. And no, this is not a Perl question. Essentially the form allows the user to specificy which links to use for Line 1, 2, 3, etc. And this can be a long form. The problem I have is that in placing the links in the VALUE field, each link shows up on each radio button. Makes it very ugly.

Is there a way to label each radio button with just text, but have it's value be the link? I tried the code below, and am still searching. But when you're new to a certain language, even Googling doesn't just give up answers.

Thanks


    <tr>
        <td>
            <label for "radio1"><input type="radio" id="radio1" name="line01" value=$primary_links[$y]>Line 1</label><br>
            <label for "radio2"><input type="radio" id="radio2" name="line02" value=$primary_links[$y]>Line 2</label><br>
            <label for "radio3"><input type="radio" id="radio3" name="line03" value=$primary_links[$y]>Line 3</label><br>
            <label for "radio4"><input type="radio" id="radio3" name="line04" value=$primary_links[$y]>Line 4</label><br>
            <label for "radio5"><input type="radio" id="radio4" name="line05" value=$primary_links[$y]>Line 5</label><br>
        </td>
        <td>
            $primary_links[$y]<p>
        </td>
    </tr>

ShawnCplus Dec 19th, 2007 5:05 pm
Re: Need some help with RADIO buttons forms
 
Well a label tag works in this way
<label for="test">Test:</label>
<input type="radio" name="test" />
You place your label's target outside of the label tags

SergioQ Dec 19th, 2007 5:11 pm
Re: Need some help with RADIO buttons forms
 
It seems to be because the VALUE is a full reference that this is happening.

So am guessing I need to consolidate all my links into a master array and make the value of each radio the element number of that array.

Ugh

ShawnCplus Dec 19th, 2007 5:15 pm
Re: Need some help with RADIO buttons forms
 
Make sure you're surrounding your values with quotes or it could create malformed HTML

SergioQ Dec 19th, 2007 5:49 pm
Re: Need some help with RADIO buttons forms
 
No, seriously, the values themselves are full URL links, and that's why the value shows up....so doing it another way.


All times are GMT -4. The time now is 12:50 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC