summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/tests/RequiredFieldValidator.html
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/tests/RequiredFieldValidator.html')
-rw-r--r--framework/Web/Javascripts/tests/RequiredFieldValidator.html95
1 files changed, 95 insertions, 0 deletions
diff --git a/framework/Web/Javascripts/tests/RequiredFieldValidator.html b/framework/Web/Javascripts/tests/RequiredFieldValidator.html
new file mode 100644
index 00000000..ae99d355
--- /dev/null
+++ b/framework/Web/Javascripts/tests/RequiredFieldValidator.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Prado Client-Side RequiredFieldValidator Tests</title>
+<style type="text/css">
+/*<![CDATA[*/
+
+ .message
+ {
+ color: red;
+ }
+ .required
+ {
+ border: 1px solid red;
+ }
+/*]]>*/
+</style>
+
+ </head>
+
+ <body>
+ <h1>Prado Client-Side RequiredFieldValidator Tests</h1>
+
+<form action="" method="post" enctype="multipart/form-data" id="form1">
+<script type="text/javascript" src="../../js/base.js"></script>
+<script type="text/javascript" src="../../js/dom.js"></script>
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+
+
+<!-- group 1 -->
+<div id="summary1"></div>
+<div>
+ <input id="text1" name="text1" type="text" value=""/>
+ <span id="validator1" class="message" style="display:none;"><a href="#text1" onclick="javascript:Prado.Validation.Util.focus('text1'); return false;" >text1!</a></span>
+
+ <span><input id="check1" type="checkbox" name="check1"/></span>
+ <span id="validator2" class="message" style="display:none;">check 1!</span>
+
+ <input id="submit1" type="submit" name="submit1" value="Group1"></input>
+
+</div>
+<!-- group 2 -->
+<div id="summary2"></div>
+<div>
+ <input id="text2" name="text2" type="text" value=""/>
+ <span id="validator3" class="message" style="visibility:hidden;">text2!</span>
+
+ <span><input id="check2" type="checkbox" name="check2"/></span>
+ <span id="validator4" class="message" style="visibility:hidden;">check 2!</span>
+
+ <input id="submit2" type="submit" name="submit2" value="Group2"></input>
+
+</div>
+
+<div id="summary3"></div>
+
+
+<input id="submit3" type="submit" name="submit3" value="Submit All"></input>
+<input id="submit4" type="submit" name="submit4" value="Submit By Pass"></input>
+
+
+
+<script type="text/javascript">
+//<![CDATA[
+
+ if(typeof(Prado) == 'undefined')
+ alert("Unable to find Prado javascript library '../../base.js'.");
+ else if(Prado.Version != 2.0)
+ alert("Prado javascript library version 2.0 required.");
+ else if(typeof(Prado.Validation) == 'undefined')
+ alert("Unable to find validation javascript library '../../validator.js'.");
+ else
+ Prado.Validation.AddForm('form1');
+
+new Prado.Validation.Summary({id:"summary1", form:"form1", displaymode:"BulletList", group:"group1"});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator1", controltovalidate:"text1", errormessage:"<a href=\"#text1\" onclick=\"javascript:Prado.Validation.Util.focus(\'text1\'); return false;\" >text1!</a>", display:"Dynamic", controlcssclass:"required", initialvalue:""});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator2", controltovalidate:"check1", errormessage:"check 1!", display:"Dynamic", controlcssclass:"required", initialvalue:""});
+Prado.Validation.AddGroup({id:"group1", target:"submit1"}, ["validator1", "validator2"]);
+Prado.Validation.AddTarget('submit1');
+
+new Prado.Validation.Summary({id:"summary2", form:"form1", displaymode:"BulletList", group:"group2"});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator3", controltovalidate:"text2", errormessage:"text2!", controlcssclass:"required", initialvalue:""});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator4", controltovalidate:"check2", errormessage:"check 2!", controlcssclass:"required", initialvalue:""});
+Prado.Validation.AddGroup({id:"group2", target:"submit2"}, ["validator3", "validator4"]);
+Prado.Validation.AddTarget('submit2');
+
+new Prado.Validation.Summary({id:"summary3", form:"form1", displaymode:"BulletList"});
+Prado.Validation.AddTarget('submit3');
+//]]>
+</script>
+</form> \ No newline at end of file