Friday, May 8, 2015

How to submit a form using javascript in ATG

Today I spent lots of time to figure out how to submit a form in ATG platform. I tired many times and with the help of Google, I finally find the solution,

1. make sure to set type="hidden" to the input field of the formHandler  handleXXX method, like this:

<dsp:form id="myForm">
   <dsp:input type="hidden"  bean="MyFormHandler.handleMethod" value="" />


2. in  your javascript method, you just need to call:


I found when I typed type="submit" for the input field, and  the handleXXX method is never called when the form is submitted through the javascript.


1 comment: