From: mkanat%bugzilla.org <> Date: Mon, 21 Sep 2009 22:02:28 +0000 (+0000) Subject: Bug 388830: Use JS to make sure there's a Description value when submitting an attachment X-Git-Tag: bugzilla-3.5.1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e0d373be5b1736837e711e5983e704aa906cc06;p=thirdparty%2Fbugzilla.git Bug 388830: Use JS to make sure there's a Description value when submitting an attachment Patch by Max Kanat-Alexander r=dkl, a=LpSolit --- diff --git a/js/attachment.js b/js/attachment.js index d3ba267967..b62555fbe4 100644 --- a/js/attachment.js +++ b/js/attachment.js @@ -21,6 +21,15 @@ * Marc Schumann */ +function validateAttachmentForm(theform) { + var desc_value = YAHOO.lang.trim(theform.description.value); + if (desc_value == '') { + alert(BUGZILLA.string.attach_desc_required); + return false; + } + return true; +} + function updateCommentPrivacy(checkbox) { var text_elem = document.getElementById('comment'); if (checkbox.checked) { diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index c265ae567a..0b965bc4ef 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -38,7 +38,9 @@ doc_section = "attachments.html" %] -
+ diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index 3116f0019a..f8044976db 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -206,6 +206,11 @@ var BUGZILLA = { param: { cookiepath: '[% Param('cookiepath') FILTER js %]' + }, + + string: { + attach_desc_required: + 'You must enter a Description for this attachment.' } }; [% IF javascript %]