How to turn this into automatic?

Discussion in 'PHP' started by Johnburk, Feb 24, 2006.

  1. #1
    In the following code, please have to select a radio button and then press OK.

    How can this be made so that when pressing OK it is automaticly selected as the value of beeing checked?


          echo "<div class='content'>";
    echo "<form action=\"subscription.php\" method=\"post\" name=\"sub_form\"".($popup ? " target=\"formPopup\"" : "")." onsubmit=\"submitform();false;\">
     		<input type=\"text\" size=\"".($popup ? "15" : "15")."\" name=\"email_addr\" value=\"".translate("EMAIL_ADDRESS")."\" onfocus=\"if (this.value=='".translate("EMAIL_ADDRESS")."') this.value=''\" />
    &nbsp;<input type=\"button\" name=\"sub\" value=\" OK \" onclick=\"submitform()\" /><br />\n
        <input type=\"radio\" class='radio' name=\"op\" value=\"join" ;
    
      if(!$conf->sub_validation) echo "_direct";
      echo "\" checked=\"checked\" /> ".translate("NEWSLETTER_SUBSCRIPTION")."\n";
      echo "\t\t<input type=\"radio\" class='radio' name=\"op\" value=\"leave";
      if(!$conf->unsub_validation) echo "_direct";
      echo "\" /> ".translate("NEWSLETTER_UNSUBSCRIPTION");
    PHP:

     
    Johnburk, Feb 24, 2006 IP
  2. neroux

    neroux Active Member

    Messages:
    566
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #2
    I am not sure what you want. It seems you already have chosen one as default.
     
    neroux, Feb 28, 2006 IP