Reputation: 537
I want to post form and a textarea outside a form, i tried this code but its not working
<script>
function updateuseracc(form, password)
{
var p = document.createElement("input");
var newemail=$("#newemail");
form.appendChild(p);
p.name="p";
p.type="hidden";
p.value=hex_sha512(password.value);
password.value="";
$.post('updateuser.php',$('#myform').serialize(),textarea:textarea).done(function(data){
alert('Account Successfuly Updated');
});
}
</script>
Upvotes: 1
Views: 201
Reputation: 115222
You can pass it like this
$.post('updateuser.php', $('#myform').serialize() + "&textarea=" + textarea).done(function(data) {
alert('Account Successfuly Updated');
});
Upvotes: 2