diff options
author | Vinzenz <vinzenz.rosenkranz@gmail.com> | 2016-08-28 15:27:07 +0300 |
---|---|---|
committer | Vinzenz <vinzenz.rosenkranz@gmail.com> | 2016-08-28 15:27:07 +0300 |
commit | 2edb4804e44a15a3fb866b57b4dee643210e853e (patch) | |
tree | 2462e21d56df38621859ac008d178e3270aea5de /js/vote.js | |
parent | 997dc2f2247dd88ec5b6b82f2a8d05664a21b5e4 (diff) |
allow anonymous comments
Diffstat (limited to 'js/vote.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.')); |