Issues submitting form with jquery
<p>I have been trying to submit a form with jquery ajax but have been having issues. 
When i check through firebug i see the value posted but it shows error from the url. I have this html</p>

<pre><code>&lt;form method="post" name="tForm" id="tForm"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;Age&lt;/td&gt;
&lt;td&gt;&lt;input name="age" id="age" value="" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;input type="button" id="submit" value="submit"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>My js file that submits the form has this piece of code</p>

<pre><code>$(document).ready(function() {

$('#tForm').submit(function(){
var age = $('#age').val();
var msg ='';

$.ajax({
url:'testp.php',
type:'post',
data: {age:age},
beforeSend:function(){
alert(age);
},
success:function(data){
msg=data;
alert(msg);
},
complete:function(){
alert(msg);
}
})
})
});
</code></pre>

<p>My testp.php file just has this</p>

<pre><code>&lt;?php
echo 'ok';
?&gt;
</code></pre>
