0
I created a form that will be submitted via Jquery, more specifically: http://malsup.com/jquery/form/.
Well, send the form, the php file is recognized, it returns the error messages and everything else, the problem is that it does not recognize the data received via POST. Follows the codes:
Jquery:
function editProfile(){
$("#edit-profile").ajaxSubmit({
url: "/ajax/edit_user_profile.php",
success: function(result){
$("#result").html(result);
if(result['error'] == false){
$("#result").html("Salvo com sucesso!");
}
else{
$("#result").html(result['msg_error']);
}
},
beforeSend: function(result){
if(result['error'] == true){
$("#result").html(result['msg_error']);
}
},
error: function(e){
$("#result").html("Error!");
},
type: "POST"
});
}
Summary of the form (HTML):
<form id="edit-profile" method="POST">
<!--Nome e sobrenome-->
<label class="form">
<b>Nome</b>
<input type="text" class="input text" placeholder="Nome..." name="name" maxlength="255" value="<?php echo $user['name'] ?>" required>
</label>
...
I put the isset($_POST)
and he recognizes, but the isset($_POST['name'])
, for example, he does not recognize.
Does anyone know what might be wrong? I made two forms with a structure virtually identical to this one recently, and it was first...
Add id="name" to the input, to see
– Sr. André Baill
Didn’t work :(
– Artur
Run a test, put id="name" name="name" just to see
– Sr. André Baill
I did just that
– Artur
And nothing tbm????/
– Sr. André Baill
Nothing, he recognizes that there is POST, but not the form....
– Artur
probably sending empty.. use browser debug console. On Chrome, press CTRL+SHIFT+I and go to the Network tab. Look for the request part so you can make sure which data is being sent..
– Daniel Omine
Really, you’re not sending the data, how do I resolve it? I think it’s in HTML,...
– Artur
I found out, it was such a silly hahaha thing. The modal that opened the form had the same form id...
– Artur