webFormControl v1.08
Source
Below is the complete source code for a working example. You might want to view this in a seperate window.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>webFormControl source code sample</title>
<script type="text/javascript" src="/lib/js/livedonkey.webFormControl.js"></script>
</head>
<body>
<h1>webFormControl source code sample</h1>
<form method="post" name="sampleForm" id="sampleForm" onsubmit="return false;" onreset="">
<!-- rules -->
<input type="hidden" name="requiredRules" value="txtArtistName:alp:5-35; txtAge:1-:num; txtPassword:equ:4-25; txtEmail:0-:ema; radOriginalMusic; selExperience; txtDescription:255:alp; txtNote" />
<!-- turn this off when form is working as required: 1=on, 0=off -->
<input type="hidden" name="requiredDebug" value="1" />
<!-- tells script not to display prefixes you might want to use for server parsed scripts e.g. txtFieldName, chkFieldName, radFieldName etc, will only show FieldName -->
<input type="hidden" name="requiredIgnorePrefix" value="txt,rad,opt,rad,chk,sel" />
<!-- alert|popup|span: popup is recommended for debugging -->
<input type="hidden" name="requiredMsgType" value="popup" />
<!-- title appended to the top of the msg -->
<input type="hidden" name="requiredMsgTitle" value="An error occurred" />
<!-- text appended to the top of the msg -->
<input type="hidden" name="requiredMsgHead" value="You have missed some stuff man! Please check out your entires and amend the errors found below." />
<!-- text appended to the bottom of the message -- make sure you encode special chars like ", as %22 below, otherwise that will screw the script up -->
<input type="hidden" name="requiredMsgFoot" value="<a href=%22javascript:self.close();%22>Close</a> this window to continue" />
<!-- absolute css file url to link in -- remember to look at css file on how to format popup window -->
<input type="hidden" name="requiredMsgCSS" value="popupWindow.css" />
<p>
Artist Name <i>(ArtistName)</i><br />
<input type="text" name="txtArtistName" id="txtArtistName" size="35" />
</p>
<p>
Artist Age <i>(Age)</i><br />
<input type="text" name="txtAge" id="txtAge" size="5" />
</p>
<p>
Choose a password <i>(Password)</i><br />
<input type="text" name="txtPassword" id="txtPassword" size="25" /><br />
<input type="text" name="txtPassword_check" id="txtPassword_check" size="25" /><i>(confirm password)</i>
</p>
<p>
Artist Email <i>(Email)</i><br />
<input type="text" name="txtEmail" id="txtEmail" size="45" />
</p>
<p>
Is your music original? <i>(OriginalMusic)</i><br />
<label for="rad1"> Yes <input type="radio" name="radOriginalMusic" id="rad1" value="yes" /></label>
<label for="rad2"> No <input type="radio" name="radOriginalMusic" id="rad2" value="no" /></label>
</p>
<p>
Experience <i>(Experience)</i><br />
<select name="selExperience" id="selExperience">
<option value=""> -- select one -- </option>
<option value="1 Year">1 Year</option>
<option value="2 Years">2 Years</option>
<option value="3 Years">3 Years</option>
<option value="4 Years">4 Years</option>
<option value="5 Years">5 Years</option>
<option value="6 Years">6 Years</option>
<option value="7 Years">7 Years</option>
</select>
</p>
<p>
Artist Description <i>(Description)</i><br />
<textarea name="txtDescription" id="txtDescription" cols="42" rows="7"></textarea>
</p>
<p>
Note <i>(Note)</i><br />
<input type="text" name="txtNote" id="txtNote" size="35" />
</p>
<p>
<input type="submit" name="Submit" id="Submit" value="Submit" onclick="return webFormControl( document.forms[0] );" />
<input type="reset" name="Reset" id="Reset" value="Reset" />
</p>
</form>
</body>
</html>
Download: webFormControl.v1.08.zip
| top
- webFormControl
-
webFormControl.v1.08
size: 27 KB
Start animating your own single framed images with this
easy little script. » more