Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: use form.setDefaultButton instead of ugly javascript trickery

...

<input type="submit" style="display: none;">

add some javascript to Tell the form to hit the ajaxsubmitbutton when the form is submittedwhich button 'return' should be attached to:

form.add(new AttributeModifier("onSubmit", true, new Model("document.getElementById('" + ajaxSubmitButton.getMarkupId() + "').onclick();return false;"))setDefaultButton(ajaxSubmitButton);