Simple PHP radio buttons

Hi. I'm trying to program some radio buttons to put in an ASP
form, using PHP coding. I just need something simple for three
yes/no questions.
I've looked around online and haven't found anything of much
help. Any help is appreciated.
Thanks. :)

Well, that's probably not the best example. Let's try this
one -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Radiobutton Test</title>
</head>
<body>
<?php
if (isset($_POST['submit']) && $_POST['submit'] ==
'SUBMIT') {
echo "Radiobutton = " . $_POST['radiobutton'] . "<br
/>";
?>
<form name="form1" method="post" action="">
<label for="radiobutton">red</label>
<input name="radiobutton" type="radio" value="red"
id="redbutton">
<label for="label">green</label>
<input name="radiobutton" type="radio" value="green"
id="greenbutton">
<label for="radio">blue</label>
<input name="radiobutton" type="radio" value="blue"
id="bluebutton">
<input type="submit" name="submit" id="submit"
value="SUBMIT">
</form>
</body>
</html>
You can see it working here -
http://www.murraytestsite.com/radiobuttontest.php
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Murray *ACE*" <[email protected]> wrote
in message
news:[email protected]...
> There's still a good deal of information missing here.
Perhaps a look at
> this code/page will help you figure out what needs to be
added to your PHP
> script -
>
> <?php
>
> if (isset($_POST['submit']) && $_POST['submit']
== 'SUBMIT') {
> foreach($_POST as $key => $value) {
> echo $key . " => " . $value . "<br>";
> }
> exit();
> }
>
>
> ?>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "
http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
> <title>Radiobutton Test</title>
> </head>
>
> <body>
> <form name="form1" method="post" action="">
> <label for="radiobutton">red</label>
> <input name="radiobutton" type="radio" value="red"
id="redbutton">
> <label for="label">green</label>
> <input name="radiobutton" type="radio" value="green"
id="greenbutton">
> <label for="radio">blue</label>
> <input name="radiobutton" type="radio" value="blue"
id="bluebutton">
> <input type="submit" name="submit" id="submit"
value="SUBMIT">
> </form>
> </body>
> </html>
>
> Your script will need to pick up the value of the
radiobutton group, as I
> have done above, and add it to the body of the mail
message.
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
> ==================
>
>
> "Quiet Winter" <[email protected]>
wrote in message
> news:[email protected]...
>> Yes, it seems I'm confusing you, so I'll post it.
The HTML not working
>> thing
>> was actually something to do with my FTP provider,
so I won't even go
>> into that
>> anymore, since it's off-subject for what you can
help me with.
>>
>> Here's my PHP script:
>>
>> <?php
>>
>> $EmailFrom = "[email protected]";
>> $EmailTo = "[email protected]";
>> $Subject = "Referral Information";
>> $Name = Trim(stripslashes($_POST['Name']));
>> $Date = Trim(stripslashes($_POST['Date']));
>> $Address = Trim(stripslashes($_POST['Address']));
>> $City = Trim(stripslashes($_POST['City']));
>> $State = Trim(stripslashes($_POST['State']));
>> $Zip = Trim(stripslashes($_POST['Zip']));
>> $Email = Trim(stripslashes($_POST['Email']));
>> $Phone = Trim(stripslashes($_POST['Phone']));
>>
>>
>> $validationOK=true;
>> if (Trim($Name)=="") $validationOK=false;
>> if (!$validationOK) {
>> print "<meta http-equiv=\"refresh\"
content=\"0;URL=error.htm\">";
>> exit;
>> }
>>
>> $Body = "";
>> $Body .= "Name: ";
>> $Body .= $Name;
>> $Body .= "\n";
>> $Body .= "Date: ";
>> $Body .= $Date;
>> $Body .= "\n";
>> $Body .= "Address: ";
>> $Body .= $Address;
>> $Body .= "\n";
>> $Body .= "City: ";
>> $Body .= $City;
>> $Body .= "\n";
>> $Body .= "State: ";
>> $Body .= $State;
>> $Body .= "\n";
>> $Body .= "Zip: ";
>> $Body .= $Zip;
>> $Body .= "\n";
>> $Body .= "Email: ";
>> $Body .= $Email;
>> $Body .= "\n";
>> $Body .= "Phone: ";
>> $Body .= $Phone;
>>
>>
>> $success = mail($EmailTo, $Subject, $Body, "From:
<$EmailFrom>");
>>
>> if ($success){
>> print "<meta http-equiv=\"refresh\"
content=\"0;URL=sent.html\">";
>> }
>> else{
>> print "<meta http-equiv=\"refresh\"
content=\"0;URL=error.htm\">";
>> }
>> ?>
>>
>> The form is mostly fill-ins, as you can see, and I
want to add three
>> yes/no
>> questions.
>>
>

Similar Messages

  • I can't get formMail.php to recognize my simple Spry Radio Group button

    I don't know php at all, but I have a dreamweaver form that sends its information to a document called "formmail.php" and that sends the email to me.
    I was able to add text fields by duplicating the text field code in the formmail.php file and it does work, BUT i don't know what code should be on the file to process the radio button information. The radio button group is made up of 2 buttons "Yes" and "No"
    This is a abbreviated version of "formmail.php"
    <body>
    <?php
      $name=addslashes($_POST['name']);
      $address=addslashes($_POST['address']);
      $email=addslashes($_POST['email']);
      $radioGroup1=addslashes($_POST['arrangements']);
      $comments=addslashes($_POST['message']);
    // you can specify which email you want your contact form to be emailed to here
      $toemail = "[email protected]";
      $subject = "From the VFS website";
      $headers = "MIME-Version: 1.0\n"
                ."From: \"".$name."\" <".$email.">\n"
                ."Content-type: text/html; charset=iso-8859-1\n";
      $body = "Name: ".$name."<br>\n"
                ."Address: ".$address."<br>\n"
    ."Email: ".$email."<br>\n"
    ."Have you made pre-arrangements?: ".$radioGroup1."<br>\n"
                ."Comments:<br>\n"
                .$comments;
      if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
        echo "That is not a valid email address.  Please return to the"
               ." previous page and try again.";
        exit;
        mail($toemail, $subject, $body, $headers);
        echo "Thanks for submitting your comments";
    ?>
    </body>
    </html>
    And this is what the code for my Spry Radio Group button is looking like.
    <p id="arrangements"><span id="spryradio1">
                                          <label>
                                            <input type="radio" name="RadioGroup1" value="Yes" id="RadioGroup1_0">
                                            Yes  </label>
                                          <label>
                                            <input type="radio" name="RadioGroup1" value="No" id="RadioGroup1_1">
                                            No</label>
                                            <br>
                                          <br>
    </span></p>
    Please help - I'm lost!

    The post form method gets a variable, by name and sends that value to your processor.  You have called $_POST['attachments'] which is the name of the container <p> tag and not of the radio group.  So change:
    $radioGroup1=addslashes($_POST['arrangements']);
    to
    $radioGroup1=addslashes($_POST['RadioGroup1']);
    That changes the <p> arrangements to the RadioGroup1 which is the name you gave the radio group.

  • Radio buttons and PHP

    I am having a problem getting radio button data into php and I can not seem to find any answers. My project is simple I have a group of radio buttons, when one is selected and a submit button is pressed I want the data from the radio button to populate the subject line of an email and send it. It sounds simple but I am having a lot of problems figuring it out and would appreciate any help I can get. I am good (not great) with flash, ok with PHP but for some reason this is taking a long time to fugure out. I can make a form work with input fields but not with radio button data.

    Use variables, not the text field var option from the Properties panel... not a reliable resource.  Give the textfield an instance name and use its text property to assign the value to a variable.
    I haven't dealt with AS2 to PHP much, but are you using the LoadVars class to manage getting the data to the PHP file?  I think the send() or sendAndLoad() methods are what you want to use.
    If you search Google using "AS2 LoadVars" you are likely to find a number of helpful tutorials, including those that focus on PHP being in the picture.

  • Radio Buttons for Flash PHP email.

    Hi.
    I need to add a sign-up form for services to a flash AS2 web site.
    I found a very simple example of a Flash/ PHP email form at Kirupa.
    It works fine, but I need to add some radio buttons.
    My web site will offer various services.
    Ideally I would like to be able for viewers to sign up for a service by clicking the appropriate right radio buttons
    F.ex;
    •   Service 1
    •   Service 2
    •   Service 3
    •   Service 4
    The email should reflect the choices made by listing the text on the selected services (radio buttons).
    Please download the FLA and the PHP file (at the bottom of the tutorial) here:
    http://www.kirupa.com/developer/actionscript/flash_php_email.htm
    I have uploaded a working version here:
    http://gggraphic.com/flash_mail/simple_flash_mail.php
    How do I add and script the radio buttons with both AS and the PHP to make it happen?
    Thank you on beforehand for your help
    ggaarde

    Hi Again
    Maybe check buttons would be a more natural option for this. You should be able to select more than one service.
    Thanks
    ggaarde

  • Radio Buttons w/ Multiple Values on a PHP Form

    Hi,
    I have an Online Registration form with several options that each have their own prices.  I want the form results to show the name of each option the user selects, and the total of all the prices combined.  My question is how can I do that when each radio button only allows you to attach one value?  Is there a way to somehow retrieve the option name and price as two separate values?
    <input name="option" type="radio" value="Cotton - $10" />
    <input name="option" type="radio" value="Suede - $15" />
    <input name="option" type="radio" value="Leather - Black - $20" />
    <input name="option" type="radio" value="Leather - White - $20" />
    For example, if they select 'Leather - Black - $20" I want to be able to retrieve one value of "Leather - Black" and another value of "20.00" (to add to the total price) rather than simply "Leather - Black - $20" in one value.
    Any help would be greatly appreciated!  I've only had to deal with one value for each radio button in the past.
    Thanks!
    Paul

    Yes you can do this.  If I were you I would eliminate the space in the value just to eliminate confusion.  Then when you process the variable use the Explode function ( http://php.net/manual/en/function.explode.php ) to separate the values in your string.  So if you eliminate the space your code would look like:
    $_POST['option'] = $option;
    $option = explode ("-",$option);
    print $option[0]; //This would print the material
    print $option[1]; //This would print the price
    The only trick is your first two options don't have a color.  So your arrays would be different.  To offset this I would recommend that you use the same format for all options and make some sort of null value if nothing will be added for one value in the array, ie: color.

  • Issue: Flash radio buttons & Php form

    I have a flash form which all of the fields are sending
    correctly
    through the php code. The flash radio buttons I added with
    the
    groupname == topic, doesnt send with the rest of the
    information that is being sent to the email. My question is
    how do I get
    the flash radio button info to submit with the rest of the
    form.
    The code for the send button on my flash file:
    on (release) {
    // send variables in form movieclip (the textfields)
    // to email PHP page which will send the mail
    form.loadVariables("form.php", "POST");
    ===============================================
    ===============================================
    Form.php:
    <?php
    $to = "[email protected]";
    $subject = "Contact Page Information for Today";
    $headers = "From: " . $_POST["name"];
    $headers .= "<" . $_POST["email"] . ">\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= "Return-Path: " . $_POST["email"];
    $message .= "\n\n";
    $message .= "Subject: " . $_POST["topic"] . "\r\n";
    $message .= "Email: " . $_POST["email"] . "\r\n";
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "Address: " . $_POST["address"] . "\r\n";
    $message .= "City: " . $_POST["city"] . "\r\n";
    $message .= "State: " . $_POST["state"] . "\r\n";
    $message .= "Zip Code: " . $_POST["zip"] . "\r\n";
    $message .= "Phone: " . $_POST["phone"] . "\r\n\n";
    $message .= "Message: " . $_POST["message"] . "\r\n";
    mail($to, $subject, $message, $headers);
    ?>
    Text

    Do you mean like this:
    <?php
    var topic;
    var listenerObject:Object = new Object();
    listenerObject.click = function(eventObj:Object) {
    topic = eventObj.target.data;
    trace(topic)
    groupTopic1_rb.addEventListener("click", listenerObject);
    groupTopic2_rb.addEventListener("click", listenerObject);
    groupTopic3_rb.addEventListener("click", listenerObject);
    groupTopic4_rb.addEventListener("click", listenerObject);
    groupTopic5_rb.addEventListener("click", listenerObject);
    groupTopic6_rb.addEventListener("click", listenerObject);
    groupTopic7_rb.addEventListener("click", listenerObject);
    groupTopic8_rb.addEventListener("click", listenerObject);
    groupTopic9_rb.addEventListener("click", listenerObject);
    groupTopic10_rb.addEventListener("click", listenerObject);
    groupTopic11_rb.addEventListener("click", listenerObject);
    groupTopic12_rb.addEventListener("click", listenerObject);
    groupTopic13_rb.addEventListener("click", listenerObject);
    groupTopic14_rb.addEventListener("click", listenerObject);
    $to = "[email protected]";
    $subject = "Contact Page Information for Hope Today";
    $headers = "From: " . $_POST["name"];
    $headers .= "<" . $_POST["email"] . ">\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= "Return-Path: " . $_POST["email"];
    $message .= "\n\n";
    $message .= "Subject: " . $_POST["topic"] . "\r\n";
    $message .= "Email: " . $_POST["email"] . "\r\n";
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "Address: " . $_POST["address"] . "\r\n";
    $message .= "City: " . $_POST["city"] . "\r\n";
    $message .= "State: " . $_POST["state"] . "\r\n";
    $message .= "Zip Code: " . $_POST["zip"] . "\r\n";
    $message .= "Phone: " . $_POST["phone"] . "\r\n\n";
    $message .= "Message: " . $_POST["message"] . "\r\n";
    mail($to, $subject, $message, $headers);
    ?>

  • Please help! How can I validate Radio Buttons and List Menu with PHP.

    Hello everyone, I have been learning PHP step by step and
    making little projects.
    The point is I find it easy to learn by doing "practical
    projects."
    I have been reading the David Powers's Book on PHP Solutions
    and it's really great, however there is nothing mentioned regarding
    Validating Radio buttons. I know the book cannot cover every aspect
    of PHP and maybe someone in here can help.
    I have been learning how to process HTML forms with PHP.
    The problem is every book or tutorial I have read or
    encountered fall short on validation.
    I'm wondering how I can learn to validate Radio Buttons and
    Select List Menu.
    I have managed to create validation for all other fields but
    have no clue as to how I can get validation for Radio Buttons and
    List Menu.
    I would also like an error message echoed when the user does
    not click a button or make a selection and try to submit the form.
    I would appreciate any help.
    Patrick

    It's not that default value is "None." In fact it's not. It
    will only be
    "none" when the form is submitted.
    Also if your submit button is names 'send' then
    $_POST['send'] will only be
    set if the form was submitted.
    Make sure you didn't hit the refresh button on your browser
    which usually
    reposts the information. Also make sure you did not reach the
    form from
    another form with the same button names.
    Otherwise paste the snippet.
    Also you can check what fields are set in the post array by
    adding this to
    the top of (or anywhere on) your page:
    print_r($_POST);
    Cosmo
    "Webethics" <[email protected]> wrote in
    message
    news:[email protected]...
    >
    quote:
    Originally posted by:
    Newsgroup User
    > Off the top of my head this should be no different than
    your radio buttons
    > except that 'productSelection' will always fail the
    !isset check when the
    > form is submitted since the default value is "None", and
    therefore always
    > set. :-)
    >
    > So how about this..?
    > <?php
    > if (isset($_POST['send']) and
    ($_POST['productSelection'] == "None"))
    > {echo "Please select a product.";}
    > ?>
    >
    >
    >
    >
    > "Webethics" <[email protected]> wrote
    in message
    > news:[email protected]...
    > > Another question - how do i applied the code you
    just showed me to
    > > select
    > > menu
    > > or select list?
    > >
    > > This is the list:
    > >
    > > <div class="problemProduct">
    > > <label for="productSelection"><span
    class="product_label">Product
    > > Name.</span></label>
    > > <select name="productSelection" id="products"
    class="selection">
    > > <option value="None">-------------Select a
    product----------</option>
    > > <option value="Everex DVD Burner">Everex DVD
    Burner</option>
    > > <option value="Vidia DVD Burner">Vidia DVD
    Burner</option>
    > > <option value="Excerion Super Drive">Excerion
    Super Drive</option>
    > > <option value="Maxille Optical Multi
    Burner">Maxille Optical Multi
    > > Burner</option>
    > > <option value="Pavilion HD Drives">Pavilion
    HD Drives</option>
    > > </select>
    > > </div>
    > >
    > > I thought I could just change the name is the code
    from operatingSystem
    > > to
    > > productSelection.
    > >
    > > Something like this:
    > >
    > > From this:
    > >
    > > <?php
    > > if (isset($_POST[send]) and
    !isset($_POST['operatingSystem']))
    > > {echo "Please select an operating system.";}
    > > ?>
    > >
    > > To this:
    > >
    > > <?php
    > > if (isset($_POST[send]) and
    !isset($_POST['productSelection']))
    > > {echo "Please select an operating system.";}
    > > ?>
    > >
    > > But this does not work, any ideas?
    > >
    > > Patrick
    > >
    >
    >
    >
    >
    > Hey, I tried this about but as you mentioned, since the
    default product
    > value
    > is "None" an error message appears when the page loads.
    >
    > Is there a way to code this things so that even though
    the default value
    > is
    > "None" there ia no error message untle you hit the
    submit?
    >
    > When I applied the code, it messes up the previous code,
    now the operating
    > system is requiring an entry on page load.
    >
    > When I remove the code from the list menu everything
    goes back to normal.
    >
    > I know this is a little much but I have no other
    alternatives.
    >
    > Patrick
    >

  • Radio button variable not being emailed through php file.

    Dear Forum,
    I have a contact form in a AS 2.0 file that sends the form data just fine to my email. But it doesn't send the radio button selection variable.
    I am definately doing something wrong here.  Either with the setup of the radio buttons in flash, or with the php file.
    I was wondering if someone can tell me the error in my ways.
    I have included a screenshot of flash page, download link with all files, and the php code below.
    Any advice or help would be greatly appreciated.
    Thanks
    Jeff
    Boise, ID
    email: aaajeff<at>hotmail.com
    http://www.thevodkarevolution.com/email.zip
    http://www.thevodkarevolution.com/flashscreenshot.jpg
    Email.php file:
    <?php
    $sendTo = "[email protected]";
    $subject = "revolution - message";
    $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" .
    $_POST["email"] .">\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= "Return-path: " . $_POST["email"];
    $body = $_POST["name"] ." ". $_POST["email"] ." ". $_POST["message"] ." ".
    $_POST["industry"];
    mail($sendTo, $subject, $body, $headers);
    ?>

    I solve that problem, you also have to add the property
    radioButton1.setOnClick("common_timeoutSubmitForm(this.form, 'rbID');");
    and with this method will call the othe method :D
    Hope this is not too latte. :D

  • Radio button data to php form

    I set up a survey, and I need the info from the radio button
    groups to send to a php form that will email me the results. So far
    I have not been able to get it to work. All I have so far is the
    code below attached to the submit button. I had a working contact
    form that I am trying to add radio buttons to, but they do not pass
    their info like the input text boxs do. I am a beginner with
    actionscript so I am having trouble finding where to get this to
    work. I have all my peramiters set on each radio button too. I just
    do not know what script to add to what I have so it will pass the
    data over to the php form.
    I have the survey as one MC which is inside a scroll pane if
    that matters. What I have so far can be seen here.
    http://ebinx.com/carrand/freestuffswf.swf
    Thanks

    bump

  • PHP Form Validation: Radio Buttons

    Hey everyone -
    I'm trying to do two things here with an addition to one of
    my forms using
    PHP.
    1. Attempting to validate if one of the radio buttons has
    been selected.
    2. Displaying which radio button is selected once the page is
    reloaded
    (checking for validation errors). That is - if they've
    selected a radio
    button but didn't fill in the other area - I want the radio
    button they've
    already selected to be actually "selected" once the page
    reloads.
    Here is the series of radio buttons:
    <input type="radio" name="subject" id="subject1" value="1"
    />
    <label for="subject1" class="labelbold">I wish to
    contact you regarding
    website design</label><br />
    <input type="radio" name="subject" id="subject2" value="2"
    />
    <label for="subject2" class="labelbold">I wish to
    report a technical
    error</label><br />
    <input type="radio" name="subject" id="subject3" value="3"
    />
    <label for="subject3" class="labelbold">I wish to
    report an error with the
    copy</label><br />
    <input type="radio" name="subject" id="subject4" value="4"
    />
    <label for="subject4"
    class="labelbold">Other</label><br />
    This is how I'm validating my checkboxes:
    if($_POST['confirmbox'] == false) $error[] = "Check the
    Privacy Policy
    Agreement Box";
    However, using "false" doesn't seem to matter with the radio
    buttons. So,
    how can I get the radio buttons to validate that ONE was
    selected and how
    can I show that selected button on a page reload (I'm
    thinking I may need to
    dynamically generate the value=""....<?php...?>....?).
    Thanks!
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================

    Hello there -
    After no replies - I decided to strain my brain (ha-ha) - and
    finally
    figured out the solution to the problem.
    For the curious - I added this to each <input...>
    field:
    <?php if($_POST['subject'] == "1") echo'
    checked="checked"';?>
    And then for each <input...> I changed the "1" to the
    corresponding value
    each field was given.
    Have a wonderful night. :)
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "Shane H" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hey everyone -
    >
    > I'm trying to do two things here with an addition to one
    of my forms using
    > PHP.
    >
    > 1. Attempting to validate if one of the radio buttons
    has been selected.
    >
    > 2. Displaying which radio button is selected once the
    page is reloaded
    > (checking for validation errors). That is - if they've
    selected a radio
    > button but didn't fill in the other area - I want the
    radio button they've
    > already selected to be actually "selected" once the page
    reloads.
    >
    > Here is the series of radio buttons:
    >
    > <input type="radio" name="subject" id="subject1"
    value="1" />
    > <label for="subject1" class="labelbold">I wish to
    contact you regarding
    > website design</label><br />
    >
    > <input type="radio" name="subject" id="subject2"
    value="2" />
    > <label for="subject2" class="labelbold">I wish to
    report a technical
    > error</label><br />
    >
    > <input type="radio" name="subject" id="subject3"
    value="3" />
    > <label for="subject3" class="labelbold">I wish to
    report an error with the
    > copy</label><br />
    >
    > <input type="radio" name="subject" id="subject4"
    value="4" />
    > <label for="subject4"
    class="labelbold">Other</label><br />
    >
    > This is how I'm validating my checkboxes:
    >
    > if($_POST['confirmbox'] == false) $error[] = "Check the
    Privacy Policy
    > Agreement Box";
    >
    > However, using "false" doesn't seem to matter with the
    radio buttons. So,
    > how can I get the radio buttons to validate that ONE was
    selected and how
    > can I show that selected button on a page reload (I'm
    thinking I may need
    > to dynamically generate the
    value=""....<?php...?>....?).
    >
    > Thanks!
    >
    > --
    > Shane H
    > [email protected]
    >
    http://www.avenuedesigners.com
    >
    > =============================================
    > Proud GAWDS Member
    >
    http://www.gawds.org/showmember.php?memberid=1495
    >
    > Delivering accessible websites to all ...
    > =============================================
    >
    >
    >

  • Simple query reg radio button

    Hii All
    In my report i am creating two radio buttons normally when we create radio buttion text comes first then radio button comes
    But i want first radio button comes then corresponding text to my radio button appears
    Helpful Answers will be rewarded
    regards
    Hitesh

    Hi
    see this selection screen design
    TABLES EKKO.
    ********END OF DATA DECLARATIONS*********
    ********SELECTION SCREEN DESIGN ***********
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.
    SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    ******END OF SELECTION SCREEN DESIGN****************
    double click that text elements and write what ever you want and activate it
    thats all

  • Simple "show / hide" script using radio buttons, need a little help

    Hello;
    I have a place in my form where I need to swap out what type of form you need to fill out in an area. If I don't do this, it makes the page look over crowded and if I pass it off to a 2 or 3 step process, it doesn't have enough info in each section to be worth it. It's either one or the other.
    Right now, this code works nice. click on a radio button, and the form section appears and disappears. What I am trying to make this do it when the page loads, one of the radio buttons is selected and one of the form sections is visible. Then if you click on the other radio button, it swaps them.
    can anyone help me tweek this code so one of the buttons is selected all the time?
    here is my script.
    <style type="text/css">
    .showHide {
    position: absolute;
    background-color: #f1f1f1;
    width: 350px;
    padding: 1px;
    color: black;
    border: #999999 2px dashed;
    display: none;
    </style>
    <script language="JavaScript">
    function setVisibility(id, visibility) {
    document.getElementById(id).style.display = visibility;
    </script>
    <form>
    <input name=type type=radio onclick="setVisibility('sub3', 'inline');setVisibility('sub4','none');" value='male' checked>Selection 1
    <input type=radio name=type value='female' onclick="setVisibility('sub3', 'none');setVisibility('sub4','inline');";>Selection 2
    <div id="sub3" class="showHide">Selection 1 content</div>
    <div id="sub4" class="showHide">Selection 2 content</div>
    </form>
    That's the short of it with out dumping tons of other code on anyone.
    Thank you

    That's what I need. I tweeked it a little and now it doesn't work. Can
    you help me add one last option? I need 3 buttons that intereact leaving the red one still visible when it loads unless you click on
    one of the others. this is what I'm trying to do:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#divGrey').hide();
    $('#divRed').show();
    $('#divBlue').hide();
    $('.grey').click(function(){
    //$(this).hide();
    $('#divGrey').show();
    $('#divRed').hide();
    $('#divBlue').hide();
    $('.red').click(function(){
    //$(this).hide();
    $('#divGrey').hide();
    $('#divRed').show();
    $('#divBlue').hide();
    $('.blue').click(function(){
    //$(this).hide();
    $('#divGrey').hide();
    $('#divRed').hide();
    $('#divBlue').show();
    </script>
    <style type="text/css">
    #divGrey {
    position: absolute;
    background-color: #f1f1f1;
    width: 350px;
    padding: 1px;
    color: black;
    border: #999999 2px dashed;
    display: none;
    #divRed {
    position: absolute;
    background-color: #f1f1f1;
    width: 350px;
    padding: 1px;
    color: black;
    border: #999999 2px dashed;
    display: none;
    #divBlue {
    position: absolute;
    background-color: #f1f1f1;
    width: 350px;
    padding: 1px;
    color: black;
    border: #999999 2px dashed;
    display: none;
    </style>
    <input type="radio" name="Radio1"  value="" id="RadioGroup1_1" checked="checked"  />Selection 1
    <input type="radio" name="Radio1"  value="checked" id="RadioGroup1_0" />Selection 2
    <input type="radio" name="Radio1"  value="checked" id="RadioGroup1_2" />Selection 3
    <div id="divRed">Selection 1 content</div>
    <div id="divGrey">Selection 2 content</div>
    <div id="divBlue">Selection 3 content</div>
    it isn't doing anything right now, and no errors either that I can see. Any ideas?

  • Radio Buttons, Coldfusion and HTML

    Hello.
    I want to use 4 radio buttons. Each one has a different $
    amount. The user chooses a radio button ($ amount) and then clicks
    on the PayPal donation button which sends the user to the PayPal
    payment page with the correct $ amount chosen.
    The HTML code for the PayPal link allows me to use the
    following code:
    <input type="hidden" name="amount"
    value="<cfoutput>#MoneyAmount#</cfoutput>">
    I just have to figure out how to get the MoneyAmount chosen
    by the user depending on which radio button is chosen.
    I do not want to put the radio button into another form
    because as I understand it the user would have to click another
    submit button first via cfform. That defeats the purpose. Any way
    to find out which button is chosen with out using the submit
    button?
    If you are confused at what I am talking about, check out
    this website that has what I want:
    http://www.licadho.org/donation.php
    They do it with Javascript but I am sure I can do it in
    ColdFusion.
    Any ideas.
    I appreciate the help.
    Pedro

    They appear to do it with a simple form, not javascript.
    Plus, they have radio buttons on the form. What exactly are you
    having difficutly with?

  • Using a Radio Button to Disable Multiple Checkboxes

    Hi everyone,
    My name is Christian and I am trying to design a form using Adobe Designer 7 that when a user selects a group of two radio buttons (one marked Macintosh and one marked Windows) it automatically disables 3 or 4 checkboxes of various software applications further down the page.
    The idea is if you select the Windows radio button, you would not be able to select the iWorks or StuffIT checkboxes (as that is Mac software), but conversely if you check Macintosh radio button the iWorks and StuffIT checkboxes activate but the Office 2003 and Microsoft Money checkboxes deactivate (because that is Windows software).
    Im not really a developer so any assistance would be appreciated. Thanks for reading and have a great day! :-)
    Christian

    I suspect that you have a problem in some portion of your code that you have not posted. To help debugging I suggest you create a simple test using two pages: input.cfm and action.cfm.  Get the most simple case working then add the javascript, css, and CF code to make your application work.
    <!--- contents of input.cfm --->
    <html>
    <head>
         <title>Input</title>
    </head>
    <body>
         <form action="action.cfm" method="POST">
              Choose type: <br />
              <input name="type" type="radio" value="male" />     Male<br />
              <input name="type" type="radio" value="female" /> Female<br />
              <input type="submit" />
         </form>
    </body>
    </html>
    <!--- content of action.cfm --->
    <html>
    <head>
         <title>Action</title>
    </head>
    <body>
         <cfif form.type eq "male">
              Type is male.
         <cfelseif form.type eq "female">
              Type is female.
         </cfif>
         Here is a cfdump of the form variables:<br />
         <cfdump var="#form#" />
    </body>
    </html>
    Message was edited by: JR "Bob" Dobbs
    Added sample for action.cfm

  • How to set a default pre-select for radio buttons?

    Hi
    I have some text form fields that I've set up to display some paired variables stored in a .txt file.  When the swf loads, the form fields are populated with the text.
    I've also set it up so that if you change the text and hit a submit button, the .txt file gets updated.
    I'm now tryng to set it up so that I can store radio button selections in the .txt file too.
    I've started doing it a certain way, but am wondering if there is a more straightforward way of doing ?
    Here's what I've done...
    I've set up the butttons to spit out "on" or "off" depending on the selection, and apply that to the variable that gets stored.
    Now, in the same way I loaded the variables into the text form fields when the swf is refreshed, I want to load the on/off variable, and then somehow apply it to the radio buttons so that one of them is pre-selected.
    So my questions are a) how do I take that loaded variable, and use an if statement to make it pre-select the button, and b) is there a simpler way to pre-select a button based on an external variable?
    Thanks
    Shaun

    Nevermind guys - I did it using the 'rb_on.selected' command on the "on" radio button if the .txt file variable was "on", else the "off" radio button is selected.
    Thanks for taking a look though!
    Shaun

Maybe you are looking for

  • How do I transfer photos from iphoto to my ipad 2

    how do I transfer photos from iPhoto to my iPad 2

  • Invisible text in PDF form

    I've seen this twice now over the last couple of months under Acrobat Pro 9.3.2. I've created forms for folks attending an event to complete. They download these forms from a web site, complete them, and click a button I've built into the form to e-m

  • Metadata Extraction query modification

    Hi, I have extracted metadata in Parent child format by doing some modifications through the query provided on following link http://camerons-blog-for-essbase-hackers.blogspot.com/2011/09/stupid-planning-queries-5-dimension.html Now i want output in

  • PNP LDP Authorization

    Hello All, I am using PNP LDP on my report, the authorization are skipping some personnel numbers saying insufficient authorization. But my program requires all the personnel number to be downloaded, please let me know how this can be achieved. Thank

  • Swf from folder cannot be played on firefox

    I have these swf files that can't play on firefox. I have checked the plugins, it says swf(octet-string) would play on the flash player but not the plugin, and I can't choose for it to play using the plugin.