Bug Tracker

Modify

Ticket #3477 (closed bug: wontfix)

Opened 6 years ago

Last modified 6 years ago

Validate Plugin - metadata messages influence behaviour

Reported by: pduijves Owned by: joern
Priority: minor Milestone: 1.3
Component: plugin Version: 1.2.6
Keywords: Validate Plugin metadata messages Cc:
Blocking: Blocked by:

Description (last modified by joern) (diff)

hi! i think i ran into a bug;

when i validate a form with the input field below, validate also triggers if the input is not numeric, though i don't want it to and don't tell it to.

<input type="text" id="addressb2" name="addressb2" value="" class="{validate:{required:true, messages:{required:'Street number is required'}}}"/>

adding the rule number:false does not help.

i found a workaround by breaking the word 'number' in the custom error message:

<input type="text" id="addressb2" name="addressb2" value="" class="{validate:{required:true, messages:{required:'Street <span>n</span>umber is required'}}}"/>

which could be a clue, that words in the custom message text are matching rules somewhere

thanks for the great plugin!

ps: i couldn't find a way to attach this message straight to the right plugin...

Change History

comment:1 Changed 6 years ago by pduijves

...some html is filtered from the message. i meant:

i found a workaround by breaking the word 'number' in the custom error message:

<input type="text" id="addressb2" name="addressb2" value="" class="{validate:{required:true, messages:{required:'Street num ber is required'}}}"/>

comment:2 Changed 6 years ago by flesler

  • Owner set to joern

comment:3 Changed 6 years ago by pduijves

sorry, take 3, i meant:

i found a workaround by breaking the word 'number' in the custom error message:

<input type="text" id="addressb2" name="addressb2" value="" class="{validate:{required:true, messages:{required:'Street num&lt;!----&gt;ber is required'}}}"/>

comment:4 Changed 6 years ago by joern

  • Description modified (diff)

comment:5 Changed 6 years ago by joern

  • Status changed from new to closed
  • Resolution set to wontfix

In this case using metadata with the class attribute doesn't work. There are plenty alternatives for specifying messages, or configure the validation plugin to search in a custom attribute for the rules/messages.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.