Section | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Note |
---|
This behavior will only be present when the form is opened using a share URL - you will not see it in Test mode. To test it, copy the form's share URL and paste it into a new browser tab. |
Constrain Visible Table Rows and Add Scrollbar
Let's say you have a table in a read-only form that has 100+ rows. To keep the form user-friendly, you want to restrict the visible table rows to a specific height and force a scrollbar to appear. Add this custom javascript:
Code Block |
---|
// frevvo custom JavaScript
var CustomEventHandlers = {
setup: function (el) {
document.getElementsByClassName('table-scroll')[0].style.height = "275px";
document.getElementsByClassName('table-scroll')[0].style.overflowY = "scroll";
}
} |
Then on your table, set the CSS Class 'table-scroll'.
Automatically submit a form
This JavaScript example is relevant to Forms only. Let's say you have a new customer registration Form A that is normally forwarded to Forms B and C to complete registration for a new user. Returning Users skip Form B and go directly to form C.
This JavaScript example will automatically submit a form if a certain control has some specific value (say “not-new”) in it when the form is loaded. This might be useful in cases where a form needs to be submitted to post the data in it, but interaction between the form and user is not necessary. If the user's input is not required, this custom JavaScript can submit the form automatically.
...
This JavaScript example will submit the form when the user presses the Enter key. If you want to do this in a workflow, change SubmitView.doSubmit("Submit"); to FlowView.getFlowButton().onclick();
...