Location: PHPKode > scripts > Rapid Form Builder > rapid-form-builder/example.php
<?php  

	session_start();
	$sid = $_REQUEST['sid'] ;
	if (!isset($sid)) { $sid = 1 ; }
	$_SESSION['sid'] = $sid ;

	include "presentationLayer.php" ; 
	$displayField = new presentationLayer() ; 
	$displayTextArea = new presentationLayer() ; 
	
	echo "<a href=\"http://digitallight.ca\"><img src=\"images/digitalLight.gif\" border=\"0\"></a> <br>" ; 
	echo "<br><strong>Note to developers:</strong><br> " ; 
	echo "Each text field was built with a single line of code including validation and error messages.<br> " ;
	echo "This is one of the lines:  <strong> &lt;? echo $displayField->displayField(usr1_username, 0, 20, \"\", 1, $sid); ?&gt; </strong> <br> " ;
	echo "To see different forms, change the sid (in the URL) to be &lt; 10 <br><br>" ;
	
	echo "<br><strong>Note to Users:</strong><br> " ; 
	echo "You do not need to hit the submit button.  All fields are updated via \"AJAX\". <br> This page is an 'example' only.<br><br><br><br>" ; 

?>

<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script
	type="text/javascript" src="javascript/ajaxforms.js" language="javascript"></script>
</head>

<body>

<form action="" method="post" name="ajaxform">
Change a field, and hit Tab
<table class=ajform>
	<tr>
			  	<?php  
					echo $displayField->displayField(usr1_username, 0, 20, "", 1, $sid);
					echo $displayField->displayField(txt1_password, 0, 20, "", 2, $sid);		
					echo $displayField->displayField(eml1_email, 0, 20, "", 3, $sid); 
					echo $displayField->displayTextArea(aln0_description, 0, 20, 2, "", 4, $sid);
					echo $displayField->displayField(alp1_city, 0, 20, "default", 5, $sid);
					echo $displayField->displayField(phn1_phone, 1, 20, "", 6, $sid);
					echo $displayField->displayField(dig0_ext, 1, 20, "", 7, $sid);
					echo $displayField->displayField(dig1_age, 0, 20, "", 8, $sid);
				?> 
			 </tr>
			  
			  			<tr>
				<td class="mandatoryField"> * </td>
			  	<td class="formLabel">
					<LABEL FOR="sel1_country" accesskey="O">C<u>o</u>untry</LABEL> 
				</td> 
				<td class="formField">
					<select name="sel1_country" OnBlur="CheckField(this)" width="20" tabindex = "9">
					<option value="">Select...</option>
					<option value="CA">Canada</option>
					<option value="GB">United Kingdom</option>
					<option value="US">United States of America</option>
					<option value="XX">Outside US and Canada</option>
					</select>   
					<span id="sel1_countryout" class="message"></span>
				</td>
			 </tr>
			 
			<tr>
				<td class="mandatoryField"> * </td>
			  	<td class="formLabel">
					<LABEL FOR="chk1_terms" accesskey="T"><u>T</u>erms</LABEL> 
				</td>
				<td class="formField">
					<input id="chk1_terms"  type="checkbox" name="chk1_terms" value="check" OnBlur="CheckCheckBox(this)" tabindex="10"> I accept the <a href = ""> Terms of use</a>				
					<span id="chk1_termsout" class="message"></span>
				</td>
			 </tr>	
			 
	</tr>

</table>

<input type="submit" value="Submit"></form>
<br><br>
Christopher Knott, 2009.    <br>
Version: 0.1 <br>
Please see the <a href = "readme.txt" >readme</a> for the database information or <a href = "rapidFormBuilder.zip">download the source</a>.<br> <br>


</body>
</html>
Return current item: Rapid Form Builder