sendAddress
(File
> New > File) in the forms directory within your cartridge
(Navigator view:
Cartridge/forms/default/sendAddress.xml
) using the
following elements:
Option | Description |
---|---|
For the... | Use... |
header |
|
name |
|
email address |
|
message |
|
send (Action) |
|
footer |
|
formid
, form label
and
type
. Specify if the field is mandatory and any error
conditions and messages.
name
field includes a defined message if the form is
submitted without a name value.
emailaddress
field) to validate a field. If the field
doesn't meet the regexp requirements, the form fails
validation.
<
action>
element's
formid
is the name of the action when the form is
submitted. This name is used in the pipeline to determine on which
path the processing will continue. For validation to be performed, you
must set it to valid-form="true"
. If you don't, the
Forms Framework lets the form continue with invalid
data.
<?xml version="1.0"?>
<form>
<field formid="name" label="Name" type="string"
mandatory="true" missing-error="Your Name is Mandatory"/>
<field formid="emailaddress" label="Email Address"
type="string" mandatory="true"
regexp="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
value-error="Invalid Email Address"/>
<field formid="message" label="Message"
type="string" mandatory="true"/>
<action formid="send" valid-form="true"/>
</form>
sendAddress
to render the form
(File > New > ISML Template) in the templates directory
within your cartridge (Navigator view:
Cartridge/templates/default/sendAddress.isml
), as
follows:
<
isinputfield>
tag.
<
isinclude
template="util/modules">
sendAddress
form instance in the
Pipeline Dictionary.
<
form
action="${URLUtils.httpsContinue()}" method="post"
id="${pdict.CurrentForms.sendAddress.htmlName}">
<
table
border="0">
name
input field to be stored in
the Pipeline Dictionary.
<tr>
<isinputfield
formfield="${pdict.CurrentForms.simpleform.name}"
value="${pdict.CurrentForms.sendAddress.name.htmlValue}"
type="input">
</tr>
simpleform.emailaddress
for browser input.
<tr>
<isinputfield
formfield="${pdict.CurrentForms.simpleform.emailaddress}"
value="${pdict.CurrentForms.sendAddress​.emailaddress.htmlValue}"
type="input">
</tr>
simpleform.sendAddress
for browser input.
<tr>
<isinputfield
formfield="${pdict.CurrentForms.sendAddress.message}"
type="textarea" attribute1="rows" attribute2="cols"
value1="6" value2="50">
</tr>
Send
action for browser
input.
<input class="image
imageright" type="image"
src="${URLUtils.staticURL('/images/cont_bttn.gif')}" value="Send"
name="${pdict.CurrentForms.sendAddress.send.htmlName}" />
<
/form>
Make
sure you give the file name an ISML extension. Also, make this a
valid ISML file by including the previous lines within the
<
html><body>
tags,
or include it as part of an existing template.
<
isinputfield>
ISML tag;
while the Framework handles all the validation and rendering of
any messages that are defined in the form definition
file.next
transition off the interaction continue node
to render error messages if the user doesn't enter data correctly
into the fields. In this case, it returns to the interaction continue
node.
send,
and in the case of
this pipeline, another template is rendered, showing the posted data
from the form.sendaddress.
Were you able to get your original application running? For example, get the SiteGenesis application running before you attempt this sample application.
© Copyright 2000-2023, Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. |
Show URL | Submit Feedback | Privacy Policy |