At the moment if a form has several mandatory fields on and the user clicks a submit button the user only gets warning feedback about the first issue.
This means that a user can go through a loop of hit button, see warning message, fix issue, hit button, see warning message . . . . . . . . .
I've seen several sites online where their forms provide a list of issues and highlight the appropriate fields. This allows a user to fix all issues before hitting submit again.
This would be a good enhancement to the product (imho).
Thanks
Mandatory field feedback
Moderators: Jon, Steve, Ian, Dave
- dvanhussel
- Ebase User
- Posts: 161
- Joined: Fri Oct 19, 2007 12:45 pm
- Location: Haarlem, the Netherlands
Hi,
This is already possible with Ebase, see: http://forum.ebasetech.com/forum/viewtopic.php?t=507
But it requires some custom JavaScript in which you have to define the validation criteria.
It would be nice if the 'default validation criteria' of Ebase would be available in JavaScript.
something like this:
it could return the text that is displayed in a popup when default validation is used.
Ofcourse, a form setting would be needed to dissable the validation popups when this kind of validation is used.
This is already possible with Ebase, see: http://forum.ebasetech.com/forum/viewtopic.php?t=507
But it requires some custom JavaScript in which you have to define the validation criteria.
It would be nice if the 'default validation criteria' of Ebase would be available in JavaScript.
something like this:
Code: Select all
var isValid = fields.FIELDNAME.isValid();
Ofcourse, a form setting would be needed to dissable the validation popups when this kind of validation is used.
0 x
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
Hi thanks something to think about.
I found that isMandatory exists so could be possible instead of defining the mandatory fields in several places and loop through allControls on the page.
eg
Like you say it would be good to have something like isValid()
I found that isMandatory exists so could be possible instead of defining the mandatory fields in several places and loop through allControls on the page.
eg
Code: Select all
var blnError = false;
var ErrorMessage = '';
for each (var ctrl in form.currentPage.allControls)
{
if (ctrl.getElementType() == 'Field Control')
{
if (ctrl.isMandatory())
{
if(!ctrl.field.value)
{
ErrorMessage += ctrl.field.labelText.text + '<br>';
ctrl.setStyle('background-color:yellow');
blnError = true;
}
}
}
}
if (blnError)
{
ErrorMessage = 'The following fields are mandatory<br>' + ErrorMessage;
pages.PAGE_1.addErrorMessage(ErrorMessage);
}
Like you say it would be good to have something like isValid()
0 x
Who is online
Users browsing this forum: No registered users and 41 guests