www.webdeveloper.com
Results 1 to 5 of 5

Thread: Form to Email send text fields but not radio buttons value

  1. #1
    Join Date
    May 2010
    Posts
    12

    Form to Email send text fields but not radio buttons value

    Hi guys,

    I use a freeware script from Internet as a form to email and it does very well with text fields and textarea field. I am trying to add some radio buttons to this form but I cannot get the value of them in email. It is blank.
    Could you help me please to resolve this issue?

    Thank you!

    HTML Code:
    <div class="form-inner">
      	<label for="year" >Year: <span class="required">*</span></label><br/>
      	<input type="text" name="year" id="year" value="<?php echo $formproc->SafeDisplay('year') ?>" maxlength="50" /><br/>
      	<p id="form_year_errorloc" class="error"></p>
    </div>
    <div class="form-inner">
      	<label for="drivable" >Is your car drivable? <span class="required">*</span></label><br/>
      	<input name="drivable" id="drivable-yes" type="radio" value="<?php echo $formproc->SafeDisplay('yes') ?>" />Yes <br />
            <input name="drivable" id="drivable-no" type="radio" value="<?php echo $formproc->SafeDisplay('no') ?>" />No
     	<p id="form_drivable_errorloc" class="error"></p>
    </div>
    I get the value of Year text field but not the value of radio buttons.

    See full files attached.

    sell-your-car-now.php.zip
    send_quote.php.zip
    Last edited by geo86; 11-18-2013 at 05:45 PM.

  2. #2
    Join Date
    Jan 2013
    Posts
    4
    I just run the abode code and it seems to work properly.

    Unse the $_POSt method to collect the information from the radio;

    Try the following code in the file set at the form action:

    echo '<pre>';
    print_r($_POST);
    echo '</pre'>;
    die();

    Once you do that copy and paste the results here, all data should be there if the method on the form is set to post:

    <form action="file.php" method="post">
    your code here
    </form>

  3. #3
    Join Date
    May 2010
    Posts
    12
    Quote Originally Posted by kamoiran View Post
    I just run the abode code and it seems to work properly.

    Unse the $_POSt method to collect the information from the radio;

    Try the following code in the file set at the form action:

    echo '<pre>';
    print_r($_POST);
    echo '</pre'>;
    die();

    Once you do that copy and paste the results here, all data should be there if the method on the form is set to post:

    <form action="file.php" method="post">
    your code here
    </form>
    The original script doesn't work. (it is running on a live host now).

    The code above displays:
    Array
    (
    [submitted] => 1
    [name] => nume
    [drivable] => yes
    [Submit] => Send
    )
    Last edited by geo86; 11-19-2013 at 03:59 PM. Reason: misunderstood the above post

  4. #4
    Join Date
    May 2010
    Posts
    12
    Solved!

    I have replaced value="<?php echo $formproc->SafeDisplay('yes') ?>" with value="Yes".
    Now is working.

    Thank you for your help!

  5. #5
    Join Date
    Nov 2013
    Posts
    1

    Leran php

    If you are freasher or a final year student
    Here is your chance to earn while learn
    Get the right start at the right time with the right product for your Bright career.
    Know the best about your potential and improvement areas.
    Strengthen your Study habits and academics.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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