Jump to: navigation, search

PHP HTML Dynamic Form From with Ajax

From w3cyberlearnings

Contents

PHP Dynamic Form uses Ajax

Use Ajax to load form to main page.

Example 1

page.html: HTML main page

<html>
	<head>
		<title>Form</title>
		<script type="text/javascript"           
				  src="jquery.min.js">
		</script>
		<script type="text/javascript">
			$(document).ready(function() {
				$('div#myform').load('form1.html');
			});
		</script>
	</head>
	<body>

		<div id="myform"></div>

	</body>
</html>

form1.html: HTML form to be loaded to the main page

This is the HTML form that use by the Ajax to load to the main page.

<form method="post">
<table border="0">
	<tr>
		<td>
			Login Name:
		</td>
		<td>
			<input type="text" name="login_name"/>
		</td>
	</tr>
	<tr>
		<td>
			Password:
		</td>
		<td>
			<input type="password" name="login_password"/>
		</td>
	</tr>
	<tr>
		<td colspan="2"><input type="submit"/></td>
	</tr>
</table>
</form>

Output

Php html dynamic form ajax 1.png

Related Links


Dynamic HTML From Array
  1. Dynamic Drop Down List with Array
  2. Dynamic List with Array
  3. Dynamic Radio with Array
  4. Dynamic Checkbox with Array
Dynamic HTML From Database
  1. Dynamic Drop Down List with Database
  2. Dynamic List from Database
  3. Dynamic Radio from Database
  4. Dynamic Checkbox from database
Dynamic HTML with Ajax
  1. Dynamic Drop Down List with Ajax
  2. Dynamic List with Ajax
  3. Dynamic Radio with Ajax
  4. Dynamic Checkbox with Ajax
  5. Dynamic Form with Ajax
Others Related
  1. Dynamic Drop down with default option
  2. How to retrieve Form Data
Navigation
Web
SQL
MISC
References