Avatar of peter_coop
peter_coop
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

Radio button only passes value on refresh

hello
What is happening is that when the page is first loaded, the radio button value is passed correctly and all elements are cleared successfully. If i then enter another entry, the radio button values are not passed to the processing php page. I have to refresh the browser and then the value is passed. (Firebug confirms this). I would be grateful if someone could check my code an point out the error that would cause this. I have pasted the code here:

http://jsfiddle.net/YY2cw/ 

but I am including the php page here that collects the radio button value. I cannot see where to attach at jsfiddle.net. Many thanks for your help.

contact-ajax.php

    <?PHP
    /*Get the posted values from our form*/
    $name2=$_POST['name2'];
    $position2=$_POST['position2'];
    $company2=$_POST['company2'];
    $email2=$_POST['email2'];
    $phone2=$_POST['phone2'];
    $contact2=$_POST['contact2'];
    $subject = "General Enquiry";
   
                
     
    /*Clean posted values through mysql real escape string*/
    /*$firstname=mysql_real_escape_string($firstname);
    $lastname=mysql_real_escape_string($lastname);
    $email=mysql_real_escape_string($email);
    $emailr=mysql_real_escape_string($emailr);
    $pass=mysql_real_escape_string($pass);
    $sex=mysql_real_escape_string($sex);
    $birthday_month=mysql_real_escape_string($birthday_month);
    $birthday_day=mysql_real_escape_string($birthday_day);
    $birthday_year=mysql_real_escape_string($birthday_year);*/
     
    echo 1;
    ?>
JavaScriptPHPScripting Languages

Avatar of undefined
Last Comment
peter_coop

8/22/2022 - Mon