i have now problem with ajax sending form and couldnt find where is the error, 

here my html:

```
<form method="post" id="update-profile" name="update-form" action="process.php">

<input name="username" type="text"  id="username"  value="<?php echo $username;?>"/>
........
 <input name="update_profile" type="button" class="submit" id="update_profile" value="Update" onclick="return formValidation();" />

```

and this is my javascript :

```
    function formValidation() {
        // other validations here
    if (validsex(umsex, ufsex)) { 

          $('#mydata').html('Saving ...<img src="../images/loading.gif" />');
      $.ajax({

      url: "process.php",
      dataType: 'json' ,
      data :{    id       : document.getElementById('iidd').value,
                 username : document.getElementById('username').value,
                 name     : document.getElementById('name').value,
                   password : document.getElementById('password').value,
                    slist: document.getElementById('slist').value,
                  sexs : sexs,
                  update_profile : "update_profile",

     type : 'POST',

      success: function(msg){

       $('#mydata').html("<span >saved succefully </span>").delay(3000).fadeOut('fast');

       }
         }

           });

                         }
                    }

            }
        }

}
return false;
  }                             

```

have even debugged with this

```
     error: function(jqXHR, textStatus, errorThrown) {
    console.log(JSON.stringify(jqXHR));
    console.log("AJAX error: " + textStatus + ' : ' + errorThrown);
   }, 

```

and it said : `AJAX error: undefined : undefined` 

so i dont know what the problem.

here my process.php :

```
   if (isset($_POST['update_profile'])) {

    $id = $_POST['iidd'];
    $username = mysql_real_escape_string($_POST['username']);
    $name = mysql_real_escape_string($_POST['name']);
    $password = mysql_real_escape_string($_POST['password']);
    $country = mysql_real_escape_string($_POST['slist']);
    $sex = mysql_real_escape_string($_POST['sexs']);
 //update query here

```

thanks!.