Saturday 15 February 2014

php - How to Use HTML validation and get ajax response without e-mail and password in url -



php - How to Use HTML validation and get ajax response without e-mail and password in url -

i have login form collects user's e-mail , password. send through ajax validated on server side. ajax sends response indicate whether login succeeded or user needs register first or login failed , user has x number of attempts left before scheme block login attempts period of time. successful in including prevention of e-mail , password showing in browser's url address line. believe succeeded in using e.preventdefault() in jquery script processes click of submit button.

when utilize preventdefault() function, prevents html validation of info on client side. immediate , sufficient validation indicate problems such when user hasn't entered info in field before submission. furthermore, html validation more helpful alter indicating input field has failed validation. additional validation both on client , server sides.

i want both features: 1) html validation feedback before ajax verification; 2) no email or password showing in url address line god , country see.

i have searched solutions, possible html validation still new plenty , not sufficient true validation many developers not trying accomplish goal have stated here. therefore, not find info addressed set of issues simultaneously. appreciate feedback how accomplish in manner trying or suggested other approaches accomplish same user-friendly ends intend. here jquery code using when user clicks submit button.

// main log in $("#login_button").click(function(e) { e.preventdefault(); var email = $('#login_email').val(); var password = $('#login_password').val(); $.post('inner_pages/login_processing.php', {'login_email':email, 'login_password':password}, function(data) { //make ajax phone call check_email.php alert(data); }); }); // end of log in

i have no thought html validation remove e-mail , password in url by:

window.location.hash = '';

php jquery html ajax validation

No comments:

Post a Comment