Usefull if you want to display the error message above the field, when some of the fields are on the same line...

Comments

ramsegal’s picture

Title: Make an option to display single error message, on blur/keyup » on some of the fapi rules the custom message isnt passed
Category: feature » bug

example - email

ramsegal’s picture

oops i wanted to create a new issue, instead put this comment on the wrong place

attiks’s picture

Version: 7.x-1.31 » 7.x-1.x-dev
Category: bug » feature

If I understand you want some messages displayed at the top and some of them inline?

ramsegal’s picture

I have a form with inline fields.
i want the error to appear above the field, but only one message at a time (otherwise they show on top of each other...unless i give a specific position to each message.
I think it will be nice if on blur the relevant message will appear, and hide the others..

also it would be nice if i can override the error label html...

attiks’s picture

the module can responde to blur/focus but you need to provide a custom js to display the message you want and hide the others, i don't see a generic solution that can be added to the module, but i'm open for suggestions.

ramsegal’s picture

can you provide an example js?

thanks!

attiks’s picture

Assigned: Unassigned » Jelle_S
attiks’s picture

Title: on some of the fapi rules the custom message isnt passed » Make an option to display single error message, on blur/keyup

changing title

attiks’s picture

@ramsegal this isn't going to be easy since there's no easy way to detect which field is the active one. What might be possible is to add your own handlers to blur/focus and call the validate on a single element.

If I find a better way, I'll let you know.

ramsegal’s picture

My current solution is this:

$('div.form-item input, div.form-item select', context).bind('focusout', function() {
  $('label.error').hide();
});

So the last error message is displayed only..

attiks’s picture

jquery.validate has an option showErrors (http://docs.jquery.com/Plugins/Validation/validate#options) that might be able to solve this, but it isn't implemented inside our module.

ramsegal’s picture

feature request? :)

attiks’s picture

I'll have a look at it one of these days

Jelle_S’s picture

this setting has been added in the latest dev version, it only works if you display the error messages on top of the form though. It's quite buggy when the error messages are displayed inline.

Jelle_S’s picture

Status: Active » Fixed

This setting will now only be applied when the display error message is set to 'top of form'

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ramsegal’s picture

Is there a way to support this setting not only for top of form?

Thanks