It has always bedeviled me how to submit an ATG form using a text link. I have asked many people about this but no one seems to know. Finally with the help of ATG support I figured it out.
Below is a simple example of how to do it. The trick is the hidden submit input which triggers ATG to call the handleSubmit method of the form handler.
<%@ taglib uri="/dspTaglib" prefix="dsp"%> <dsp:page> <script> Â Â function submit(form) { Â Â Â Â form.submit(); Â Â } </script> <dsp:form action="<%=request.getRequestURI()%>" method="post" name="testForm"> Â Â Foo: <dsp:input type="text" bean="TestFormHandler.foo"/> Â Â <p><a href="javascript:submit(document.testForm)">Submit</a> Â Â <dsp:input type="hidden" bean="TestFormHandler.submit" value="Submit"/> </dsp:form> </dsp:page>
You can also invoke the JavaScript like this:
<p><a href="#" onclick="submit(document.testForm); return false;">Submit</a>