Life Capital Limited</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/objects.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script>
$(function() {
$('#addMember').on('submit', function(event) {
event.preventDefault();
var data = new FormData($(this)[0]);
var ajax = new ajaxform(data);
var results = ajax.makeRequest();
alert(results);
});
function ajaxform(data) {
this.results = "";
this.data = data;
this.makeRequest = function() {
$.ajax({
type:'POST',
url:'ajax.php',
data:this.data,
processData:false,
contentType:false,
cache:false,
success:function(responseText) {
self.results = responseText;
}
});
return self.results;
}
}
});
</script>
</head>
<body>
<div class="main-container">
<?php require_once 'includes/header.php'; ?>
<?php require_once 'includes/sidebar.php'; ?>
<div class="wrapper">
<?php require_once 'includes/breadcrumb.php'; ?>
<div class="body">
<div class="container-fluid">
<h2 class="title">Add Member</h2>
<div class="row">
<div class="col-sm-3">
</div>
</div>
<div class="box box-blue main-box">
<p class="subtitle">Personal Information</p>
<form action="" class="form-horizontal" id="addMember">
<div class="form-group">
<label for="" class="col-sm-3">First Name</label>
<div class="col-sm-9"><input placeholder="First Name..." type="text" name="fname" id="" class="form-control"></div>
</div>
<div class="form-group">
<label for="" class="col-sm-3">Middle Name</label>
<div class="col-sm-9"><input placeholder="Middle Name" type="text" name="mname" id="" class="form-control"></div>
</div>
<div class="form-group">
<label for="" class="col-sm-3">Last Name</label>
<div class="col-sm-9"><input placeholder="Last Name" type="text" name="lname" id="" class="form-control"></div>
</div>
<div class="form-group">
<label for="" class="col-sm-3">Gender</label>
<div class="col-sm-9">
<select name="gender" id="" class="form-control gender">
<option value="">select gender</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-3">Mobile Number</label>
<div class="col-sm-9"><input placeholder="Mobile Number" type="text" name="mobile" id="" class="form-control"></div>
</div>
<div class="form-group">
<label for="" class="col-sm-3">ID Number</label>
<div class="col-sm-9"><input placeholder="ID Number" type="text" name="idnumber" id="" class="form-control"></div>
</div>
here is a complete code..please help.. i have to submit the form twice to have the desired results.
Обсуждают сегодня