diff options
Diffstat (limited to 'bootstrap/comments/frontend/validateemail.js')
-rw-r--r-- | bootstrap/comments/frontend/validateemail.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bootstrap/comments/frontend/validateemail.js b/bootstrap/comments/frontend/validateemail.js new file mode 100644 index 0000000..6fedf28 --- /dev/null +++ b/bootstrap/comments/frontend/validateemail.js @@ -0,0 +1,20 @@ +// Validate a comment form e-mail field (validateemail.js) +HashOver.prototype.validateEmail = function (type, permalink, form, isReply, isEdit) +{ + type = type || 'main'; + permalink = permalink || null; + isReply = isReply || false; + isEdit = isEdit || false; + + // Subscribe checkbox ID + var subscribe = type + '-subscribe'; + + // Check whether comment is an reply or edit + if (isReply === true || isEdit === true) { + // If so, use form subscribe checkbox + subscribe += '-' + permalink; + } + + // Validate form fields + return this.emailValidator (form, subscribe, type, permalink, isReply, isEdit); +}; |