August 2005


When creating forms that are to interact with ATG form handlers, one cannot use an HTML page as the action. If one does then the ATG form handler will not be invoked.

For example, this form will not invoke the ATG form handler.

<form name="test" action="test.html" method="get">
  Name: <input type="text" bean="/TestFormHandler.name">
  <p><input type="submit" bean="/TestFormHandler.submit">
</form>

However this form will.

<form name="test" action="test.jhtml" method="get">
  Name: <input type="text" bean="/TestFormHandler.name">
  <p><input type="submit" bean="/TestFormHandler.submit">
</form>

In Internet Explorer if you have a form that has only a single line text input and if you press Enter to submit the form instead of pressing the submit button then the ATG handler for this form will not be invoked. Instead the form will act like a regular HTML form.

To get around this problem on Internet Explorer one must explicitly call the handler using a hidden input tag.

Here is an example of a simple form that illustrates this problem. The action of this form is to go to wrong.jhtml but if the ATG handler is invoked then the request is redirected to right.jhtml.

<form name="test" action="wrong.jhtml" method="get">
  Name: <input type="text" bean="/TestFormHandler.name">
  <p><input type="submit" bean="/TestFormHandler.submit">
</form>

Here is a screenshot of this form.

test form with only one input field

When I press Enter I go to the wrong page, i.e. wrong.jhtml, because the handler is not invoked.

example of a form working incorrectly

When I press the Submit button I go to the right page, i.e. right.jhtml, because the handler is invoked.

example of a form working correctly

To fix this I add this line within the form of testForm.jhtml.

  <input type="hidden" bean="/TestFormHandler.submit">

I also add this getter, which does nothing and may not be necessary for later versions of ATG, in the form handler.

  public String getSubmit() { return null; }

After doing this when I press Enter I go to the right page.

Note that with a form that has more than one input field this is not a problem.

test form with two input fields

The source for this example can be downloaded here.

  1. Modify <bugzilla>/localconfig to have the operating systems, severities, platforms,etc. that you want.
  2. Modify <bugzilla>/template/en/default/bug/create/create.html.tmpl to have the look you want for creating bugs.
  3. Modify <bugzilla>/template/en/default/bug/edit.html.tmpl to have the look you want for editing bugs.
  4. Other files that could be considered for modification under the directory <bugzilla>/template/en/default/:
    • bug/show-multiple.html.tmpl - list bugs in long format
    • global/field-descs.none.tmpl - field descriptions
    • list/edit-multiple.html.tmpl - edit multiple bugs
    • list/table.html.tmpl - list bugs in short format
    • pages/fields.html.tmpl - description of fields
    • pages/bug-writing.html.tmpl - help page for writing bugs
    • search/form.html.tmpl - help page for searching for bugs
    • search/search-help.html.tmpl - help page for searching for bugs
  5. Go to the <bugzilla> directory and run perl checksetup.pl.

To learn more, Template Customization.

« Previous Page