Form submitusing java script, form submit without submitbutton.

Form submit using javascript, jquery,registration using javascript, create registration using javascript.


first create a file index.html/php. and create form.</p>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ajax Form</title>
<script type="text/javascript" src="jquery.js"/></script>
<script type="text/javascript">
$(document).ready(function () {
var flag = true;
$('.sub_btn').live('click', function () {
if ($('.fname').val() == '') {
alert('fill fname');
flag = false;
return false;
} else {
flag = true;
if (flag) {
url: "database.php",
type: 'POST',
data: $('#ajaxform').serialize(),
success: function (data) {
if ($.trim(data) == 'success') {
window.location.href = "home.php";


<form method="get" id="ajaxform" >
<table width="60%" style="border:solid 1px #CCCCCC;" align="center">
<td>First Name</td>
<td><input type="text" name="fname" class="fname"/></td>
<td>Last Name</td>
<td><input type="text" name="lname" /></td>
<td><input type="text" name="email" /></td>
<td><input type="password" name="pass" /></td>
<td>Confirm Password</td>
<td><input type="password" name="cpass" /></td>
<td><textarea name="address"></textarea></td>

<input type="button" name="submit" class="sub_btn" value="Submit"/>




Now create database.php

///insert query here
Share Button

About admin

Leave a Reply

Your email address will not be published. Required fields are marked *


Author: pramod kumar kumawat Mob: 9269727062
Free WordPress Themes - Download High-quality Templates