Jquery tabs with forms in each tab submission to database
<p>Hi? i'm having problems with my jquery tabs in my code every time i try to submit data to the database from one of the tabs, the submit returns me to the first tab.besides that an era at the first tab to since the data is read but doesn't submit in reaching at the mysql_query();section . Please help</p>

<pre><code>if(isset($_POST['submit1'])){

if(isset($_REQUEST['Question1']) AND !empty($_REQUEST['Question1'])) {
//database insert code
 $question='1';         
 $answer =$_POST['Question1'];

    //header("location:question.php?question=$question&amp;answer=$answer"); 
//$quest = $_GET['question'];
//$ans = $_GET['answer'];
$query = "insert into answered_q(quesNo,answer) values('$question','$answer')";
$sql = mysql_query($query);
var_dump($question,$answer);    
}   
   }

  if(isset($_POST['submit2'])){
   if(isset($_REQUEST['Question2']) AND !empty($_REQUEST['Question2'])) {
//database insert code
$question='2';          
$answer =$_POST['Question2'];
$query = "insert into answered_q(quesNo,answer) values('$question','$answer')";
$sql = mysql_query($query);         
var_dump($answer);
 }}
</code></pre>

<p>the tabs
     
     <ul>
       <li>Question1</li>
       <li>Question2</li>
        </ul>
       
    <p>
    </p>

<pre><code>    &lt;input checked="checked" name="Question1" type="radio" value = "A"&gt;Male.&lt;/input&gt;
    &lt;input  name="Question1" type="radio" value= "B"&gt;Female.&lt;/input&gt;
    &lt;p align="center"&gt;
&lt;input type="submit" name="submit1" id="submit1" value="Submit" /&gt;&lt;/p&gt;
    &lt;/form&gt;&lt;/p&gt;&lt;/div&gt;
    &lt;div id="tabs-2"&gt;
&lt;p&gt;
&lt;form id="form2" name="form2" method="post"&gt;
    &lt;input checked="checked" name="Question2" type="radio" value = "A"&gt;short time span.&lt;/input&gt;
    &lt;input  name="Question2" type="radio" value= "B"&gt;one year.&lt;/input&gt;
    &lt;p align="center"&gt;
&lt;input type="submit" name="submit2" id="submit2" value="Submit" /&gt;&lt;/p&gt;
    &lt;/form&gt;&lt;/p&gt;&lt;/div&gt;
    &lt;/div&gt;
</code></pre>
