Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 924379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:20:36+00:00 2026-05-15T19:20:36+00:00

I am using a JavaScript to dynamically output a specific default text to the

  • 0

I am using a JavaScript to dynamically output a specific default text to the additional comments box in Bugzilla, based on the bug status which is selected from the drop down menu. I have tried using ‘bug.bug_status’ but this only changes on the submission of the page. The variable I have found which populates the drop down menu is ‘bug_status.name’ but when I try use this variable, it does not seem to be recognised. Has anyone any suggestions what may be causing the problem? Has anyone tried this before?

The following code has been placed at the start of the knob.html.tmpl file.

[% PROCESS global/variables.none.tmpl %]
[% # Output a specific default content in the comments box depending on bug status. %]
<script type="text/javascript">
<!--
var messages = ['Message 0', 'Message 1', 'Message 2', 'Message 3', 'Message 4',    'Message 5', 'Message 6'];
function changetext(selectObj){
   var textAreaElement = document.getElementsByName("comment")[0];
[% IF (bug_status.name == "ASSIGNED") %]
   textAreaElement.value = messages[4];
[% ELSIF(bug_status.name == "RESOLVED") %]
   textAreaElement.value = messages[5];
[% ELSE %]
   var variable1 = 0;
   variable1 = bug_status.name
   textAreaElement.value = variable1;
[% END %]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:20:37+00:00Added an answer on May 15, 2026 at 7:20 pm

    Based on your other question, it seems that you want this to change on the client side as the user is selecting a new status. However, the code that you have written in this question will change on the server side before the client sees it. Your if/else tree needs to be written in javascript instead of in Template Toolkit.

    So, something like this:

    function changetext(selectObj){
      var textAreaElement = document.getElementsByName("comment")[0];
      var currentStatus = document.getElementById("bug_status").value;
    
      if (currentStatus == "ASSIGNED") {
        textAreaElement.value = messages[4];
      } else if (currentStatus == "RESOLVED") {
        textAreaElement.value = messages[5];
      } else {
        textAreaElement.value = currentStatus;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This would appear to be a bug in the CLR… May 16, 2026 at 5:41 pm
  • Editorial Team
    Editorial Team added an answer Some of your points seem to ask for opinions but… May 16, 2026 at 5:41 pm
  • Editorial Team
    Editorial Team added an answer What you need are the best-practices (JAVA) and how it… May 16, 2026 at 5:41 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

My web form creates Input file controls dynamically using javascript: var input = document.createElement(input);
I try to add dynamically an iframe to a web page using JavaScript. I
Possible Duplicate: How can I access local scope dynamically in javascript? Hi all. We
Hey, I'm wondering how I can get the class names dynamically using jquery for
I've got a form that's dynamically created using ajax (as data for the form
have a table that dynamically generates text boxes in run time. I want to
I am trying to find a nice way to implement a text slider (examples:
I have been having some trouble finding a good way to output just the
quick back story-- I am working on ASP.Net based template editor that lets authors
The output of the asp.net datagrid doesn't include the thead and tbody elements required

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.