EWD automates HTML form processing by implicit mapping between the EWD Session and the HTML form fields. In a page that contains an HTML form, the pre-page script is used to pre-populate text and textarea fields, check checkboxes and radio buttons etc and pre-populate drop-down lists. This is done using EWD API methods that define Session values that map to your HTML form fields. Your EWD page therefore does not need to include any in-page logic to define how this is done, producing very clean and understandable pages, and making a very clear separation between the page design and the back-end programming.

When the form is submitted, EWD will automatically map the submitted form field values into the EWD Session, which eliminates then need for a great deal of code that would otherwise have to be written to access the HTTP Request values and copy them to the Session.

In order to use EWD's form automation, your form's form tag must include the attribute action="ewd". For example:

 <form method="post" action="ewd">

EWD adds two special attributes to the form's submit button tag:

For example, the following submit button will invoke a call to the Caché class method ##class(ewd.examples).setMyData and then redirect to mainMenu.ewd:

  <input type="submit" name="submit" value="Save" action="##class(ewd.examples).setMyData" 
   nextPage="mainMenu" />

This unique mechanism makes it very simple if you need multiple submit buttons in a form, each invoking a different Action script and each redirecting to a different page.

EWD's form field automation depends on the field type. Click the appropriate tabs for full details.