Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/creactiweb/_templates/templates/+package+/ajax.html
diff options
context:
space:
mode:
Diffstat (limited to 'creactiweb/_templates/templates/+package+/ajax.html')
-rw-r--r--creactiweb/_templates/templates/+package+/ajax.html41
1 files changed, 41 insertions, 0 deletions
diff --git a/creactiweb/_templates/templates/+package+/ajax.html b/creactiweb/_templates/templates/+package+/ajax.html
new file mode 100644
index 0000000..f8d5621
--- /dev/null
+++ b/creactiweb/_templates/templates/+package+/ajax.html
@@ -0,0 +1,41 @@
+{% extends "layout.html" %}
+
+{% block content %}
+<h1>{{ title }}</h1>
+
+<div id='ajax-sample' class='form'>
+ <h3>{{ _('ajax-sample') }}</h3>
+ <form method="post" action="/ajax" name="ajax-sample">
+ <input type="radio" value="option 1" name="ajax-sample">option 1<br>
+ <input type="radio" value="option 2" name="ajax-sample">option 2<br>
+ </form>
+<div>
+
+<script>
+<!--
+$(document).ready(function() {
+ $("#ajax-sample input[type='radio']").change( function() {
+ $.ajax({
+ url: '/ajax',
+ type: 'POST',
+ data: ({ 'ajax-sample' : $(this).val()}),
+ success: function(data) {
+ var _el = $('#ajax-sample-result');
+ _el.html(data.result);
+ }
+ });
+ });
+});
+-->
+</script>
+
+<!-- HELPER WAY
+{ options_ajax(_, 'ajax-sample', ['option 1', 'option 2'], '', '/ajax') }
+-->
+
+<div id='ajax-result' class='result'>
+ <h3>{{ _('ajax-result') }}</h3>
+ => <span id="ajax-sample-result"></span>
+</div>
+
+{% endblock %}