diff options
author | Patrick Simianer <p@simianer.de> | 2016-06-16 12:48:49 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-06-16 12:48:49 +0200 |
commit | e534f15ba401c6390adce293e49ecb6b15604136 (patch) | |
tree | 50bd2e051e4cd969957e1b1ce3e93aec92be1436 | |
parent | 2305d1505c6e441301b298cecf81b4a98b495ffb (diff) |
fix
-rw-r--r-- | index.php | 8 | ||||
-rw-r--r-- | js/interface.js | 2 |
2 files changed, 6 insertions, 4 deletions
@@ -5,7 +5,9 @@ <script src="js/jquery.min.js" charset="utf-8"></script> <script type="text/javascript"> var check_submit = function () { - if ($("#name").val()=="" || $("#key").val()=="") { + var name = $("#name").val().trim(); + $("#name").val(name); + if (name=="" || $("#key").val()=="" || !$("#key").val().match(/^[a-f0-9]{1,4}$/)) { alert("Please enter a session key and a name.") return; } @@ -22,12 +24,12 @@ <form method="get" name="sess" action="interface.php"> <strong>Session key:</strong> <input type="text" id="key" name="key" style="width:8em" /> - <strong>Name:</strong> + <strong>E-Mail:</strong> <input type="txt" id="name" name="name" style="width:12em" /> <strong>Session type:</strong> <select name="ui_type"> <option value="t">text</option> - <option value="g">graphical</option> + <!--<option value="g">graphical</option>--> </select> <input type="button" value="Submit" onclick="check_submit()" /> diff --git a/js/interface.js b/js/interface.js index b86bf50..089f417 100644 --- a/js/interface.js +++ b/js/interface.js @@ -286,7 +286,7 @@ var next = function () } send_data["key"] = key; - send_data["name"] = $("#name").val(); + send_data["name"] = encodeURIComponent($("#name").val().replace(/"/g, ' ').trim()); // send data if (oov_correct.value=="false" && post_edit != "") { |