Ektron CMS400.Net Reference

>>Using Other Development Frameworks > CustomJSPFunctions > Form Function

Form Function

The ecmFormBlock function displays an HTML form content block. This function has a parameter that lets you decide whether to have form tags added automatically or manually. The following is an example of form tags.

<form name="myform" action="#" onsubmit="return EkFmValidate(this);" method="post">

</form>

For more information about HTML forms, see Working with HTML Forms.

Warning! If you create a template for an existing form content block, you must manually change its quicklink to point to the new template. This change does not occur automatically. This procedure is described in Updating Default Template for Multiple Quicklinks.

Here is the format for the ecmFormBlock function:

<%= ecmFormBlock (int id, boolean formTagReqd) %>

The ecmFormBlock function attributes are explained below.

Attribute

Description

id

The “id” argument represents the form’s ID number, visible when viewing the form from the View Form screen.

formTagReqd

Allows form tags to be added automatically.

This is an example of form tags.

<form name="myform" action="#" onsubmit="return EkFmValidate(this);" method="post">

</form>

true = Add form tags automatically

false = Add form tags manually

This function is basically the same as the Form function in ASP. See Form Function for details.

The only differences between the JSP function and the ASP one are the formTagReqd parameter and the syntax for implementing it. The JSP example is below.

<tr>

      <td>

           <%= ecmFormBlock(1, true) %>

      </td>

</tr>


Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.