From 937fd13c817d19b73f29bf87b5424e47f59f7d7c Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Fri, 21 Aug 2015 10:13:11 -0400 Subject: [PATCH] Removed unnecessary name/id from comment form. --- themes/bootstrap3/js/record.js | 3 +-- themes/bootstrap3/templates/RecordTab/usercomments.phtml | 2 +- themes/jquerymobile/templates/RecordTab/usercomments.phtml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/themes/bootstrap3/js/record.js b/themes/bootstrap3/js/record.js index 4f25e70794b..73661094ea0 100644 --- a/themes/bootstrap3/js/record.js +++ b/themes/bootstrap3/js/record.js @@ -94,7 +94,7 @@ function refreshCommentList(recordId, recordSource) { function registerAjaxCommentRecord() { // Form submission - $('form[name="commentRecord"]').unbind('submit').submit(function(){ + $('form.comment').unbind('submit').submit(function(){ var form = this; var id = form.id.value; var recordSource = form.source.value; @@ -110,7 +110,6 @@ function registerAjaxCommentRecord() { data: data, dataType: 'json', success: function(response) { - var form = 'form[name="commentRecord"]'; if (response.status == 'OK') { refreshCommentList(id, recordSource); $(form).find('textarea[name="comment"]').val(''); diff --git a/themes/bootstrap3/templates/RecordTab/usercomments.phtml b/themes/bootstrap3/templates/RecordTab/usercomments.phtml index 9d88babf62c..4ec13a48f4a 100644 --- a/themes/bootstrap3/templates/RecordTab/usercomments.phtml +++ b/themes/bootstrap3/templates/RecordTab/usercomments.phtml @@ -6,7 +6,7 @@ <div id="commentList"> <?=$this->render('record/comments-list.phtml')?> </div> -<form class="comment" name="commentRecord" id="commentRecord" action="<?=$this->recordLink()->getActionUrl($this->driver, 'AddComment')?>" method="post"> +<form class="comment" action="<?=$this->recordLink()->getActionUrl($this->driver, 'AddComment')?>" method="post"> <div class="row"> <div class="col-sm-3 name"> <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>"/> diff --git a/themes/jquerymobile/templates/RecordTab/usercomments.phtml b/themes/jquerymobile/templates/RecordTab/usercomments.phtml index fe56781c83d..bfb324de331 100644 --- a/themes/jquerymobile/templates/RecordTab/usercomments.phtml +++ b/themes/jquerymobile/templates/RecordTab/usercomments.phtml @@ -6,7 +6,7 @@ <?=$this->render('record/comments-list.phtml')?> </ul> -<form name="commentRecord" id="commentRecord" action="<?=$this->recordLink()->getActionUrl($this->driver, 'AddComment')?>" method="post" data-ajax="false"> +<form action="<?=$this->recordLink()->getActionUrl($this->driver, 'AddComment')?>" method="post" data-ajax="false"> <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>"/> <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>"/> <div data-role="fieldcontain"> -- GitLab