diff options
author | Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com> | 2016-08-30 01:37:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-30 01:37:17 +0300 |
commit | 329f52e0d4fb2426c57b065071e8b8c6bd1b266c (patch) | |
tree | 9d0f961b8086f70a3b93bdd638af8181848749c9 /js | |
parent | 6bfb4072b827721ac47175cfa45c59b346d1f6c3 (diff) | |
parent | 327c2474d160bd5135c519baae1307baf8f514d4 (diff) |
Merge pull request #83 from v1r0x/anonymous-comments
allow anonymous comments
Diffstat (limited to 'js')
-rw-r--r-- | js/vote.js | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -51,6 +51,15 @@ $(document).ready(function () { $('#submit_send_comment').click(function(e) { e.preventDefault(); var form = document.send_comment; + var ac = document.getElementById('user_name_comm'); + if (ac != null) { + if(ac.value.length >= 3){ + form.elements['userId'].value = ac.value; + } else { + alert(t('polls', 'You are not registered.\nPlease enter your name to vote\n(at least 3 characters).')); + return; + } + } var comm = document.getElementById('commentBox'); if(comm.value.trim().length <= 0) { alert(t('polls', 'Please add some text to your comment before submitting it.')); |