dw.web
Class FormElement

Represents a form element.
All Known Subclasses
Properties
dynamicHtmlName
:
String
(Read Only)
A dynamic html name for the field. It can be used to suppress any autocompletion
support from a browser, e.g. for credit card related fields. It can be also
used for a unique form name, if one form is used multiple times in a page.
formId
:
String
(Read Only)
The ID of the form element. The is is unique within the parent
element of the form.
htmlName
:
String
(Read Only)
The global unique name of the field, which can be used as name
in the html form. For radio buttons this name is not unique.
parent
:
FormElement
(Read Only)
The parent within the form.
valid
:
boolean
(Read Only)
Identifies if this element and all its children elements are
valid. A form element, which was not submitted in the last
request is always valid.
validationResult
:
FormElementValidationResult
(Read Only)
Provides a combined view on the validation status as per isValid() and getError(). In
addition it also provides the data as returned by the validation in case a validation
script was used.
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
To get an instance of this class, use one of the subclass constructors.
Method Summary
clearFormElement()
:
void
This method clears the whole form.
getDynamicHtmlName()
:
String
Returns a dynamic html name for the field.
getHtmlName()
:
String
Returns the global unique name of the field, which can be used as name in the html form.
getParent()
:
FormElement
The parent within the form.
getValidationResult()
:
FormElementValidationResult
Provides a combined view on the validation status as per isValid() and getError().
invalidateFormElement()
:
void
The method can be called to explicitly invalidate a form element.
invalidateFormElement(error
:
String)
:
void
The method can be called to explicitly invalidate a field.
isValid()
:
boolean
Identifies if this element and all its children elements are valid.
Methods inherited from class
Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβthis is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Method Detail
clearFormElement
clearFormElement()
:
void
This method clears the whole form. After clearing a form it
contains no value or the default value, is not bound to any business
object and has the status of being valid.
getDynamicHtmlName
getDynamicHtmlName()
:
String
Returns a dynamic html name for the field. It can be used to suppress any autocompletion
support from a browser, e.g. for credit card related fields. It can be also
used for a unique form name, if one form is used multiple times in a page.
Returns:
a dynamic html name.
getFormId
getFormId()
:
String
The ID of the form element. The is is unique within the parent
element of the form.
Returns:
the ID of the form.
getHtmlName
getHtmlName()
:
String
Returns the global unique name of the field, which can be used as name
in the html form. For radio buttons this name is not unique.
Returns:
the global unique name of the field.
getParent
getParent()
:
FormElement
The parent within the form.
Returns:
the parent within the form.
getValidationResult
getValidationResult()
:
FormElementValidationResult
Provides a combined view on the validation status as per isValid() and getError(). In
addition it also provides the data as returned by the validation in case a validation
script was used.
Returns:
the validation status (valid, error, data)
invalidateFormElement
invalidateFormElement()
:
void
The method can be called to explicitly invalidate a form element. The
error text will be set to the one of two possible preconfigured custom
error messages associated with the form definition. The "value-error"
message will be used for FormField instances and "form-error" will be
used for FormGroup instances.
invalidateFormElement
invalidateFormElement(error
:
String)
:
void
The method can be called to explicitly invalidate a field. The error
text is set to the given error message.
Parameters:
error
-
the error text to use.