mama signin.html page eke form values ganna ajax request ekak use kala..e ajax code eken signin.php page ekata hariyata form values yanawa.eth mata signin unata passe userwa signin.php page ekata redirect wenna hadaganna ona.mama ekata signin.js file ekema --window.location.replace("php/signin.php"); kiyala demma..ethakota redirect wenawa..but form eke values $_post eken yanne na ethakota.meka hadala denna..a big help...
menna js code eka :
$(document).ready(function(){
$('.modal-trigger').leanModal({
dismissible: true, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
});
// Variable to hold request
var request;
// Bind to the submit event of our form
$("#Signin").submit(function(event){
// Abort any pending request
event.preventDefault();
if (request) {
request.abort();
}
// setup some local variables
var $form = $(this);
// Let's select and cache all the fields
var $inputs = $form.find("input, select, button, textarea");
// Serialize the data in the form
var Data = $form.serialize();
alert(Data);
// Let's disable the inputs for the duration of the Ajax request.
// Note: we disable elements AFTER the form data has been serialized.
// Disabled form elements will not be serialized.
$inputs.prop("disabled", true);
// Fire off the request to /form.php
request = $.ajax({
url: "php/signin.php",
type: "post",
data
ata
});
// Callback handler that will be called on success
request.done(function (response, textStatus, jqXHR){
// Log a message to the console
console.log("Hooray, it worked!");
//window.location.href = "php/signin.php";
//window.location.replace("php/signin.php");
});
// Callback handler that will be called on failure
request.fail(function (jqXHR, textStatus, errorThrown){
// Log the error to the console
console.error("The following error occurred: "+textStatus, errorThrown);
});
// Callback handler that will be called regardless
// if the request failed or succeeded
request.always(function () {
// Reenable the inputs
$inputs.prop("disabled", false);
});
// Prevent default posting of form
//event.preventDefault();
window.location.replace("php/signin.php");
});
});
menna js code eka :
$(document).ready(function(){
$('.modal-trigger').leanModal({
dismissible: true, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
});
// Variable to hold request
var request;
// Bind to the submit event of our form
$("#Signin").submit(function(event){
// Abort any pending request
event.preventDefault();
if (request) {
request.abort();
}
// setup some local variables
var $form = $(this);
// Let's select and cache all the fields
var $inputs = $form.find("input, select, button, textarea");
// Serialize the data in the form
var Data = $form.serialize();
alert(Data);
// Let's disable the inputs for the duration of the Ajax request.
// Note: we disable elements AFTER the form data has been serialized.
// Disabled form elements will not be serialized.
$inputs.prop("disabled", true);
// Fire off the request to /form.php
request = $.ajax({
url: "php/signin.php",
type: "post",
data
ata});
// Callback handler that will be called on success
request.done(function (response, textStatus, jqXHR){
// Log a message to the console
console.log("Hooray, it worked!");
//window.location.href = "php/signin.php";
//window.location.replace("php/signin.php");
});
// Callback handler that will be called on failure
request.fail(function (jqXHR, textStatus, errorThrown){
// Log the error to the console
console.error("The following error occurred: "+textStatus, errorThrown);
});
// Callback handler that will be called regardless
// if the request failed or succeeded
request.always(function () {
// Reenable the inputs
$inputs.prop("disabled", false);
});
// Prevent default posting of form
//event.preventDefault();
window.location.replace("php/signin.php");
});
});
