tadd preliminary prefilling function - cosmo - front and backend for Markov-Cha… | |
git clone git://src.adamsgaard.dk/cosmo | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 7ece12d9d0f27c2c6051bcdbc77369337d74d79c | |
parent 247f695a035f694f1e88cfa06b7c8ccb2ad61646 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 17 Nov 2015 13:30:40 +0100 | |
add preliminary prefilling function | |
Diffstat: | |
M index.php | 6 ++++++ | |
A js/history-form-prefiller.js | 10 ++++++++++ | |
2 files changed, 16 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/index.php b/index.php | |
t@@ -23,6 +23,12 @@ if ($_POST["g-recaptcha-response"]) { | |
// include top of html template | |
include('head.html'); | |
+if ($_GET['example'] && !empty($_GET['example'])) { | |
+?> | |
+<script type="text/javascrip" src="js/history-form-prefiller.js"></script> | |
+<?php | |
+} | |
+ | |
if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) { | |
// read status file contents | |
diff --git a/js/history-form-prefiller.js b/js/history-form-prefiller.js | |
t@@ -0,0 +1,10 @@ | |
+var PrefillMachine = { | |
+ | |
+ prefillCorrectly: function() { | |
+ $("#sample_id").val("sample00"); | |
+ | |
+ } | |
+} | |
+ | |
+// run the prefiller | |
+PrefillMachine.prefillCorrectly(); |