Merhaba arkadaşlar ajax la bazı yerleri yapmaya çalışıyorum fakat formda boş input yolladığımda veya ilgili dosyada inputun dolu olup olmadığını konrol etidiyimde boş olarak dönderiyor
ajax.js
function register(){
$.ajax({
type: "POST",
url: "php/register.php",
data: $('#registerr').serialize(),
error:function(){ $('#registerr').html("error"); },
success: function(veri) { $('#registerr').html(veri);}
});
}form kodlarim
<form class="lrgform" action="php/register.php" method="POST" id="registerr" onsubmit="return false">
<div class="lg">
<label class="lglabel" for="username">*Username</label>
<input type="text" name="username" class="lginput" required="required" placeholder="Username">
</div>
<div class="lg">
<label class="lglabel" for="password">*E-Mail</label>
<input type="email" name="email" class="lginput" required="required" placeholder="E-Mail">
</div>
<div class="lg">
<label class="lglabel" for="password">*Password</label>
<input type="password" name="password" class="lginput" required="required" placeholder="Password">
</div>
<div>
<label class="lglabel" for=""></label>
<input type="submit" class="lgbtn" name="registerrr" value="Register" onclick="register()">
</div>
</form>