Mandatory field feedback

Post any suggestions or enhancement requests about the Verj.io platform or this Forum

Moderators: Jon, Steve, Ian, Dave

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

Mandatory field feedback

#1

Postby Steve James » Wed May 21, 2014 8:48 am

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
0 x

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

#2

Postby dvanhussel » Thu May 22, 2014 9:24 am

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:

Code: Select all

var isValid = fields.FIELDNAME.isValid();
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.
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#3

Postby Steve James » Thu May 22, 2014 2:54 pm

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

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&#40;'background-color&#58;yellow'&#41;;
   			blnError = true;
   		&#125;
   	&#125;
   &#125;
 &#125;
if &#40;blnError&#41;
&#123;
	ErrorMessage = 'The following fields are mandatory<br>' + ErrorMessage;
	pages.PAGE_1.addErrorMessage&#40;ErrorMessage&#41;;	
&#125;

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