<html>
<head>
<title>Contact form</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var RecaptchaOptions = {
theme : 'custom'
};
Recaptcha.create('your public key', 'recaptcha_image', RecaptchaOptions);
Recaptcha.focus_response_field();
$('#submit_button').click(function() {
$.ajax({
type: 'POST',
url: 'coustomer_rgistration.php',
data: $('form#myform').serialize(),
dataType: 'json',
beforeSend: function() {
var resp_field = $('#recaptcha_response_field').val();
var name = $('#name').val();
var email = $('#email').val();
var pass = $('#pass').val();
var add = $('#add').val();
var zip_code = $('#zip_code').val();
var l_number = $('#l_number').val();
var m_number = $('#m_number').val();
var city = $('#city').val();
var state = $('#state').val();
var country = $('#country').val();
if (!resp_field[0] || !name[0] || !email[0] || !pass[0] || !zip_code[0] || !l_number[0] || !m_number[0] || !city[0] || !state[0] || !country[0]) {
$('#output').html('All fields are required');
return false;
}
emailpat = /^([a-z0-9])+([\.a-z0-9_-])*@([a-z0-9])+(\.[a-z0-9_-]+)+$/i;
if (!emailpat.test(email)) {
$('#output').html('The e-mail address is not valid.');
return false;
}
},
success: function(response) {
if (response.status == 'success') {
$('#formcont').html();
}
$('#output').html(response.errmessage);
}
});
});
});
</script>
</head>
<body>
<h1>Contact form</h1>
<div id="formcont">
<form id="myform">
<p>
<label for="naam">Name:</label>
<input type="text" name="name" id="name" size="30" />
</p>
<p>
<label for="email">E-mail:</label>
<input type="text" name="email" id="email" size="30" />
</p>
<p>
<label for="">Password:</label>
<input type="password" name="pass" id="pass" size="30" />
</p>
<p>
<label for="recaptcha_response_field">Address:</label>
<input type="text" name="recaptcha_response_field" id="recaptcha_response_field" size="20" />
</p>
<p>
<label for="">Zip code:</label>
<input type="text" name="zip_code" id="zip_code" size="30" />
</p>
<p>
<label for="">Land Line Number:</label>
<input type="password" name="l_number" id="l_number" size="30" />
</p>
<p>
<label for="">Mobile Number:</label>
<input type="text" name="m_number" id="m_number" size="30" />
</p>
<p>
<label for="">City:</label>
<input type="text" name="city" id="city" size="30" />
</p>
<p>
<label for="">State:</label>
<input type="text" name="state" id="state" size="30" />
</p>
<p>
<label for="">Country:</label>
<input type="text" name="country" id="country" size="30" />
</p>
<div id="recaptcha_image"></div>
<p>
<!--<label for="recaptcha_response_field">address:</label>
<input type="text" name="recaptcha_response_field" id="recaptcha_response_field" size="20" />-->
<input type="button" value="Submit" id="submit_button" />
</p>
</form>
</div>
<div id="output"></div>
</body>
</html>
i m using light box form registration form i want to insert data in mysql database from light box but it is not work form shows in light box but data will not inserted into data base i m using another php code for inserting data in database what is the problem for this code pleas can any one help me....