src/cm/media/js/lib/flexible-js-formatting/numbers/number-formatting-demo.html
author gibus
Mon, 21 May 2012 16:50:42 +0200
changeset 439 8994d24e4b2f
parent 0 40c8f766c9b8
permissions -rw-r--r--
Reverts to changeset 435, and just add {% csrf_token %} to template forgot_pw.html, since CSRF protection seems to be only here (surely because of django.contrib.auth.views).

<!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>Number-Formatting Test</title>
<script type="text/javascript" src="number-functions.js"></script>
</head>
<body>

<script type="text/javascript">
function doit(form) {
    form.elements["dest"].value = new Number(form.elements["src"].value).numberFormat(form.elements["format"].value);
    form.elements["text"].value = Number.prototype[Number.formatFunctions[form.elements["format"].value]];
}
</script>

<h1>Number-Formatting Demo</h1>

<p>Use the form below to experiment with the number-formatting functionality.
You can enter a value and a format string, and then click the button to see the
results.  The code that's generated to handle the formatting will be
displayed in the text area.</p>

<form method="get" action="">
<table>
<tr><td><label for="src">value</label></td><td><input id="src" type="text" name="src" /></td></tr>
<tr><td><label for="format">format</label></td><td><input id="format" type="text" name="format" /></td></tr>
<tr><td><label for="dest">result</label></td><td><input id="dest" type="text" name="dest" /></td></tr>
<tr><td><input type="button" onClick="doit(this.form)" value="do it!" /></td><td></td></tr>
</table>
<textarea name="text" rows="10" style="width:100%"></textarea>
</form>

</body>
</html>