Jump to content

[SOLVED] How to "checked" a radio button when ...


Recommended Posts

OK ... I hope I can explain this well.

 

I have a list of radio button from which the user could choose what records to view

  • all projects
  • by status - (option : bidding or awarded)
  • by date
  • ....

 

If the user select 'all project' it would be no problem because the button will be checked. But, if the user wants to view projects 'by status' BUT did not click at the button but instead straight away selects bidding or awarded how do I make the 'by status' radio button checked?

 

In other words, how do I automatically checked the radio button when I made a selection from an option at that particular radio button?

 

Hope my explanation is understood.

 

ToonMariner ...... thanks for replying but I don't quite understand where to put the input tag. Sorry for being 'slow'.

 

Here's my code

form action="project_db.php" method="get">
<table width="606" border="0">
  <tr>
    <td width="32"><div align="center">1.</div></td>
    <td width="564"><strong>View</strong></td>
  </tr>
  <tr>
    <td>
      <div align="center">
        <input type="radio" name="option" value="all">
        </div></td>
    <td><em>All Projects </em></td>
  </tr>
  <tr>
    <td>
      <div align="center">
        <input type="radio" name="option" value="status">
        </div></td>
    <td><em>By Status : <select name="status"><option value="">--Select--</option>
<option>Bidding</option>
<option>Awarded</option></select></em></td>
  </tr>
....
....
....

 

Hope you could point where I should place the input tag.

 

Thanks




form action="project_db.php" method="get">
<table width="606" border="0">
  <tr>
    <td width="32"><div align="center">1.</div></td>
    <td width="564"><strong>View</strong></td>
  </tr>
  <tr>
    <td>
      <div align="center">
        <input type="radio" name="option" value="all">
        </div></td>
    <td><em>All Projects </em></td>
  </tr>
  <tr>
    <td>
      <div align="center">
        <input type="radio" name="option" value="status" id="status">
        </div></td>
    <td><label for="status"><em>By Status : <select name="status"><option value="">--Select--</option>
<option>Bidding</option>
<option>Awarded</option></select></em></label></td>
  </tr>


This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.