<?php
echo '<form action="" method="post">
<table cellpadding="5" cellspacing="5">
<tr>
<td>Ad:</td>
<td><input type="text" name="ad" /><td>
</tr>
<tr>
<td>Soyad:</td>
<td><input type="text" name="soyad" /><td>
<tr>
<td>Yas:</td>
<td><input type="text" name="yas" /></td>
</tr>
<tr>
<td>E-Mail</td>
<td><input type="text"e-mail="E-Mail" /></td>
<tr>
<td></td>
<td><input type="submit" value="Gonder" id="b1"/></td>
</tr>
</table>
</form>';
?>
I would use AJAX to do anything with send data to the Server. You want to return false
on your submit when using AJAX. A simple solution to what you are asking, however, can be done as follows:
var frm = document.getElementsByTagName('form')[0];
var els = frm.elements;
frm.onsubmit = function(){
for(var i=0,l=els.length; i<l; i++){
if(els[i].value === ''){
return false;
}
}
return true;
}