AEM Forms Shorts Create Simple Form Script
Short Video which Describes creating and testing scripts in AEM Forms Designer
Transcript
The E-Informs Designer supports scripting in two languages, FormCalc and JavaScript. We’re not going to get into the differences in this module. Let’s take a look at the default scripting that comes with the current date field that we already have in our form. By taking a look at the configuration properties, we can see that it is a date-time field, and that it is a calculated value. In addition, we can see that there is a script associated with the custom field. Let’s preview the default script for this field. We can see that we have a numeric date that is displayed. We can change the date format of this field. If we take a look at the documentation, we would find that there are three values that can be placed here. Let’s change the default value to a three and see what we get. We can see now that we have a text-based date. Going back to the design view, let’s now take a look at adding a script to the Submit button. As we click on each field in the form, we can see that the hierarchy section on the left-hand side, the corresponding name of the field is highlighted. As we click on Full Name, we can see that it’s currently named as Text Field 1. We can easily make a change to the name by selecting it in the hierarchy. Let’s call it something more appropriate, like Text Full Name. Now we can reference this field as Text Full Name. We are now going to add a script to the Submit button. We would like for the script to execute when we click on the button. By typing the reference to Text Full Name in the click event, we will have some additional functions that we have available to us by clicking on the period. In this case, we would like the raw value of the Text Full Name to be Hello World once we click on the Submit button. We can now preview this, and we can see that when we click the Submit button, we end up with Hello World in the Full Name field.
recommendation-more-help
8de24117-1378-413c-a581-01e660b7163e