Problems with posting data to MySQL db
Hello. My name is Andreas otherwise online I'm Didair. But that nickname was already taken.
So my problem is that when i press my submit button the site just refreshes. Here is my Jquery code:
- <script type='text/javascript' >
$(document).ready(function(){
$("form#submit").submit(function() {
var user = ($_GET["with"]);
var textarea = $('#textarea').attr('value');
$.ajax({
type: "POST",
url: "js/message.php?to="+ user,
data: "textarea="+ textarea,
success: function(){
$('form#submit').(function(){$('div.success').fadeIn();});
alert(1);
}
});
return false;
});
});
</script>
I have checked my message.php file in the dir "js" but it works perfect.
I'm not used to be on forums so if it is anything i have forgotten to explain just ask. Also i would like to say that I'm not good with Javascript / Jquery at all. I'm just using it to refresh a div and post data.
Thx / Andreas.
P.S Sorry for my English, I'm from Sweden and I'm trying to do my best.