www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] Issue with Radios

  1. #1
    Join Date
    Apr 2008
    Posts
    136

    resolved [RESOLVED] Issue with Radios

    I am creating a scheduling system. I am having an issue with my radios, the user is able to select multiple radios when I only want them selecting one. I saw here that my code is the same, and it should be working. Any ideas?

    My code:
    HTML Code:
    <form action="schedule_form2.php" method="post">
    	<table width="150px">
        	<tr>
            	<td>
                	Scheduling System Form
                </td>
            </tr>
            <tr>
            	<td>
                	&nbsp;
                </td>
            </tr>
            <tr>
            	<td>
                	Employees<br> (Check one, click Continue)
                </td>
                <td>
                	&nbsp;
                </td>
            </tr>
            <tr>
            	<td id="emp">
                	GREG            </td>
                <td>
                	<input type="radio" name="emp1" value="GREG" />
                </td>
            </tr>
            <tr>
            	<td id="emp">
                	TASHI            </td>
                <td>
                	<input type="radio" name="emp2" value="TASHI" />
                </td>
            </tr>
            <tr>
            	<td id="emp">
                	TSERING            </td>
                <td>
                	<input type="radio" name="emp3" value="TSERING" />
                </td>
            </tr>
            <tr>
            	<td id="emp">
                	ALAN            </td>
                <td>
                	<input type="radio" name="emp4" value="ALAN" />
                </td>
            </tr>
            <tr>
            	<td id="emp">
                	JEFF            </td>
                <td>
                	<input type="radio" name="emp5" value="JEFF" />
                </td>
            </tr>
            <tr>
            	<td id="emp">
                	BRIAN            </td>
                <td>
                	<input type="radio" name="emp6" value="BRIAN" />
                </td>
            </tr>
            <tr>
            	<td>
                	<input type="submit" value="Continue" name="submit" />
                </td>
            </tr>
        </table>
    </form>
    Last edited by Design-is-BS; 07-02-2008 at 03:53 PM.
    Brian Senchak
    Graphic Designer
    DesignisBS.ca

  2. #2
    Join Date
    Jun 2008
    Posts
    277
    the 'name' for each radio should be the same.

    incidently, the id tags should be unique and <br> should be <br />

  3. #3
    Join Date
    Jun 2008
    Posts
    277
    in case that didn't make sense, something like this:

    HTML Code:
    <form action="schedule_form2.php" method="post">
    	<table width="150px">
        	<tr>
            	<td>
                	Scheduling System Form
                </td>
            </tr>
            <tr>
            	<td>
                	&nbsp;
                </td>
            </tr>
            <tr>
            	<td>
                	Employees<br /> (Check one, click Continue)
                </td>
                <td>
                	&nbsp;
                </td>
            </tr>
            <tr>
            	<td id="greg">
                	GREG            </td>
                <td>
                	<input type="radio" name="emp1" value="GREG" />
                </td>
            </tr>
            <tr>
            	<td id="tashi">
                	TASHI            </td>
                <td>
                	<input type="radio" name="emp1" value="TASHI" />
                </td>
            </tr>
            <tr>
            	<td id="tsering">
                	TSERING            </td>
                <td>
                	<input type="radio" name="emp1" value="TSERING" />
                </td>
            </tr>
            <tr>
            	<td id="alex">
                	ALEX            </td>
                <td>
                	<input type="radio" name="emp1" value="ALEX" />
                </td>
            </tr>
            <tr>
            	<td id="alan">
                	ALAN            </td>
                <td>
                	<input type="radio" name="emp1" value="ALAN" />
                </td>
            </tr>
            <tr>
            	<td id="jeff">
                	JEFF            </td>
                <td>
                	<input type="radio" name="emp1" value="JEFF" />
                </td>
            </tr>
            <tr>
            	<td id="brian">
                	BRIAN            </td>
                <td>
                	<input type="radio" name="emp1" value="BRIAN" />
                </td>
            </tr>
            <tr>
            	<td>
                	<input type="submit" value="Continue" name="submit" />
                </td>
            </tr>
        </table>
    </form>

  4. #4
    Join Date
    Apr 2008
    Posts
    136
    I changed my code to simplify it:

    HTML Code:
    <form action="schedule_form2.php" method="post">
         <h3>Scheduling System Form</h3>
         <h4>Employees (Check one, click Continue)</h4>
         <input id=" type="radio" name="emp1" value="GREG" />&nbsp;&nbsp;&nbsp;<span>GREG</span><br>
         <input type="radio" name="emp2" value="TASHI" />&nbsp;&nbsp;&nbsp;<span>TASHI</span><br>
         <input type="radio" name="emp3" value="TSERING" />&nbsp;&nbsp;&nbsp;<span>TSERING</span><br>
         <input type="radio" name="emp4" value="ALAN" />&nbsp;&nbsp;&nbsp;<span>ALAN</span><br>
         <input type="radio" name="emp5" value="JEFF" />&nbsp;&nbsp;&nbsp;<span>JEFF</span><br>
         <input type="radio" name="emp6" value="BRIAN" />&nbsp;&nbsp;&nbsp;<span>BRIAN</span><br>
         <input type="submit" value="Continue" name="submit" />&nbsp;&nbsp;<INPUT TYPE="reset" VALUE="Reset">
    </form>
    I took away the table. So I still need to apply ids?
    Brian Senchak
    Graphic Designer
    DesignisBS.ca

  5. #5
    Join Date
    Apr 2008
    Posts
    136
    Nevermind, got it to work. Thanks Cryptic.
    Brian Senchak
    Graphic Designer
    DesignisBS.ca

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles