...
Tip |
---|
Users expect the submit and cancel buttons to be located at the bottom of a form. Moving the location of the Submit control is not recommended. |
Submit on Enter Key Press
...
Code Block |
---|
if (document.layers) { document.captureEvents(Event.KEYPRESS); } document.onkeypress = function (evt) { var keyCode = evt ? evt.which : event.keyCode; if (keyCode == 13) { SubmitView.doSubmit("Submit"); } else { return true; } }; |
Continue/Finish button on top of the flow
...
Code Block |
---|
var CustomEventHandlers = { setup: function (el) { if (CustomView.hasClass(el, 'extra-submit')) { FEvent.observe(el, 'click', this.autoSubmit.bindAsObserver(this, el)); } }, autoSubmit: function (evt, el) { FlowView.getFlowButton().onclick(); } } |
...
Prevent Session Timeout
Sometimes you may need the session timeout for a particular form to be a lot longer than the default session timeout that makes sense for your entire tenant. Imagine your tenant session timeout in is set to 30 minutes. One of your forms takes a long time to fill out. You want to allow idle periods greater than 30 minutes for that form only.
...
Code Block |
---|
if(form.load) { username.value = _data.getParameter('subject.id');} |
Phone Dash
This custom JavaScript automatically inserts dashes as the user enters a phone number into a Phone control. Characters other than the dash entered into the control are deleted. Add PhoneInsert to the CSS Class property of the Phone control to enable this JavaScript.
Code Block | ||
---|---|---|
| ||
var CustomEventHandlers = {
setup: function(el) {
if (CustomView.hasClass(el, 'PhoneInsert')) {
FEvent.observe(el, 'keydown', this.formatPHONE.bindAsObserver(this, el));
FEvent.observe(el, 'keyup', this.formatPHONE.bindAsObserver(this, el));
}
},
formatPHONE: function(event, element) {
if (event.keyCode != 46 && event.keyCode != 8) {
fldVal = $(element).value;
var nom = fldVal.charAt(fldVal.length - 1);
if (isNaN(nom) && nom != "-") {
$(element).value = fldVal.substring(0, fldVal.length - 1);
} else {
if ((fldVal.length == 3) || (fldVal.length == 7)) {
$(element).value = fldVal + "-";
}
if (fldVal.length > 12) {
$(element).value = fldVal.substring(0, fldVal.length - 1);
}
}
}
}
} |