php form + radio buttons

Discussion in 'PHP' started by niravdave, May 27, 2009.

  1. #1
    I am not able to find a solution out of this code.

    I want to get rid of option 1(POST_EMAILOPTION_HIDE) & option 3 (POST_EMAILOPTION_SHOW) option and leave the option 2 (EMAIL_USEFORM) as default.

    <table border="0" cellspacing="1" cellpadding="0">
    				<tr>
    					<td><input name="showemail" type="hidden" value="0" <?php if($data['showemail']==EMAIL_HIDE) echo "checked"; ?>></td>
    					<td><?php echo $lang['POST_EMAILOPTION_HIDE']; ?></td>
    					</tr>
    				<tr>
    					<td><input name="showemail" type="radio" value="2" <?php if(!is_string($data['showemail']) || $data['showemail']==EMAIL_USEFORM) echo "checked"; ?>></td>
    					<td><?php echo $lang['POST_EMAILOPTION_USEFORM']; ?></td>
    					</tr>
    				<tr>
    					<td><input name="showemail" type="hidden" value="1" <?php if($data['showemail']==EMAIL_SHOW) echo "checked"; ?>>&nbsp;</td>
    					<td><?php echo $lang['POST_EMAILOPTION_SHOW']; ?></td>
    					</tr>
    					</table>
    HTML:
    can someone help me on this?

    cheers
    dave
     
    niravdave, May 27, 2009 IP
  2. yoes_san

    yoes_san Peon

    Messages:
    443
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not sure what you try to do here, may be this?

    
    <table border="0" cellspacing="1" cellpadding="0">               
       <tr>
          <td><input name="showemail" type="radio" value="2" checked></td>
          <td><?php echo $lang['POST_EMAILOPTION_USEFORM']; ?></td>
       </tr>     
    </table>
    
    Code (markup):
     
    yoes_san, May 27, 2009 IP
  3. niravdave

    niravdave Active Member

    Messages:
    675
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    88
    #3
    sorry if i have not been specific.

    Actually i have these three radio buttons on one of the form. I want to make option 2 default and hide option 1 and option 3.

    cheers
    dave
     
    niravdave, May 28, 2009 IP