From bcab6fcb10aa88683490bef03c607173f9c0b063 Mon Sep 17 00:00:00 2001 From: Kent Rogers Date: Mon, 5 Jul 2010 14:49:52 -0700 Subject: Bug 514618: Allow restricting the visibility and values of fields by classification. r=mkanat, r=timello, a=mkanat --- js/field.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'js') diff --git a/js/field.js b/js/field.js index 20485bcc8..0ca59918a 100644 --- a/js/field.js +++ b/js/field.js @@ -374,6 +374,20 @@ function updateCommentTagControl(checkbox, form) { } } +/** + * Reset the value of the classification field and fire an event change + * on it. Called when the product changes, in case the classification + * field (which is hidden) controls the visibility of any other fields. + */ +function setClassification() { + var classification = document.getElementById('classification'); + var product = document.getElementById('product'); + var selected_product = product.value; + var select_classification = all_classifications[selected_product]; + classification.value = select_classification; + bz_fireEvent(classification, 'change'); +} + /** * Says that a field should only be displayed when another field has * a certain value. May only be called after the controller has already -- cgit v1.2.3-24-g4f1b