summaryrefslogtreecommitdiff
path: root/includes/js/dijit/tests/form/test_TimeTextBox.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dijit/tests/form/test_TimeTextBox.html
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dijit/tests/form/test_TimeTextBox.html')
-rw-r--r--includes/js/dijit/tests/form/test_TimeTextBox.html143
1 files changed, 143 insertions, 0 deletions
diff --git a/includes/js/dijit/tests/form/test_TimeTextBox.html b/includes/js/dijit/tests/form/test_TimeTextBox.html
new file mode 100644
index 0000000..f68a28d
--- /dev/null
+++ b/includes/js/dijit/tests/form/test_TimeTextBox.html
@@ -0,0 +1,143 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Test TimeTextBox Widget</title>
+
+ <style type="text/css">
+ @import "../../../dojo/resources/dojo.css";
+ @import "../css/dijitTests.css";
+
+ .testExample {
+ background-color:#fbfbfb;
+ padding:1em;
+ margin-bottom:1em;
+ border:1px solid #bfbfbf;
+ }
+
+ body .medium {
+ width: 10em;
+ }
+
+ .noticeMessage {
+ color:#093669;
+ font-size:0.95em;
+ margin-left:0.5em;
+ }
+
+ .dojoTitlePaneLabel label {
+ font-weight:bold;
+ }
+ </style>
+
+ <script type="text/javascript" src="../../../dojo/dojo.js"
+ djConfig="isDebug: true, parseOnLoad: true, extraLocale: ['de-de', 'en-us']"></script>
+ <script type="text/javascript" src="../_testCommon.js"></script>
+
+ <script type="text/javascript">
+ dojo.require("dijit.form.TextBox");
+ dojo.require("dijit.form.ValidationTextBox");
+ dojo.require("dijit.form.NumberTextBox");
+ dojo.require("dijit.form.CurrencyTextBox");
+ dojo.require("dijit.form.DateTextBox");
+ dojo.require("dijit.form.TimeTextBox");
+ dojo.require("dojo.currency");
+ dojo.require("dojo.date.locale");
+ dojo.require("dojo.parser"); // scan page for widgets and instantiate them
+ </script>
+ </head>
+
+ <body>
+ <h1 class="testTitle">Test TimeTextBox Widget</h1>
+ <!-- to test form submission, you'll need to create an action handler similar to
+ http://www.utexas.edu/teamweb/cgi-bin/generic.cgi -->
+ <form id="form1" action="" name="example" method="">
+
+ <div class="dojoTitlePaneLabel">
+ <label for="q1">Time using local conventions with seconds</label>
+ <span class="noticeMessage">TimeTextBox class,
+ Attributes: {formatLength:'medium'}</span>
+ </div>
+ <div class="testExample">
+ <input id="q1" type="text" name="time1" class="medium" value="T17:45:00"
+ dojoType="dijit.form.TimeTextBox"
+ constraints="{formatLength:'medium'}"
+ required="true"
+ onChange="dojo.byId('oc1').value=arguments[0]"
+ invalidMessage="Invalid time." />
+ onChange:<input id="oc1" size="34" disabled value="not fired yet!" autocomplete="off">
+ </div>
+
+ <div class="dojoTitlePaneLabel">
+ <label for="q2">Time using local conventions without seconds, required, no invalid message tooltip</label>
+ <span class="noticeMessage">TimeTextBox class,
+ Attributes: {formatLength:'short'}</span>
+ </div>
+ <div class="testExample">
+ <input id="q2" type="text" name="time1a" class="medium" value="T17:45:00"
+ dojoType="dijit.form.TimeTextBox"
+ constraints="{formatLength:'short'}"
+ required="true"
+ invalidMessage="" />
+ </div>
+
+ <div class="dojoTitlePaneLabel">
+ <label for="q3"> 12 Hour Time </label>
+ <span class="noticeMessage">TimeTextBox class,
+ Attributes: {timePattern:'h:mm:ss a'}</span>
+ </div>
+ <div class="testExample">
+ <input id="q3" type="text" name="time1b" class="medium" value="T17:45:00"
+ dojoType="dijit.form.TimeTextBox"
+ constraints="{timePattern:'h:mm:ss a'}"
+ required="true"
+ invalidMessage="Invalid time." />
+ </div>
+
+ <div class="dojoTitlePaneLabel">
+ <label for="q4"> 24 Hour Time</label>
+ <span class="noticeMessage">TimeTextBox class,
+ Attributes: {timePattern:'HH:mm:ss'}</span>
+ </div>
+ <div class="testExample">
+ <input id="q4" type="text" name="time2" class="medium" value="T17:45:00"
+ dojoType="dijit.form.TimeTextBox"
+ constraints="{timePattern:'HH:mm:ss'}"
+ required="true"
+ invalidMessage="Invalid time. Use HH:mm:ss where HH is 00 - 23 hours.">
+ </div>
+
+ <div class="dojoTitlePaneLabel">
+ <label for="q5">24 Hour Time with 1 Hour TimePicker</label>
+ <span class="noticeMessage">TimeTextBox class,
+ Attributes: {timePattern:'HH:mm:ss', clickableIncrement:'T00:15:00', visibleIncrement:'T00:15:00', visibleRange:'T01:00:00'}</span>
+ </div>
+ <div class="testExample">
+ <input id="q5" type="text" name="time2" class="medium" value="T17:45:00"
+ dojoType="dijit.form.TimeTextBox"
+ constraints="{timePattern:'HH:mm:ss', clickableIncrement:'T00:15:00', visibleIncrement:'T00:15:00', visibleRange:'T01:00:00'}"
+ required="true"
+ invalidMessage="Invalid time. Use HH:mm:ss where HH is 00 - 23 hours.">
+ </div>
+
+ <script>
+ function displayData() {
+ var f = document.getElementById("form1");
+ var s = "";
+ for (var i = 0; i < f.elements.length; i++) {
+ var elem = f.elements[i];
+ if (elem.name == "button") { continue; }
+ s += elem.name + ": " + elem.value + "\n";
+ }
+ alert(s);
+ }
+ </script>
+
+ <div>
+ <button name="button" onclick="displayData(); return false;">view data</button>
+ <input type="submit" name="submit" />
+ </div>
+
+ </form>
+ </body>
+</html>