how to add fields validation message ?
See original GitHub issuei have to add fields validation message in my repeater template. So the message container attribute must be improved at the same time as the corresponding inputs
This is the <span>
attribute data-validate-for
(very important as it receives the error message with ajax if the field is not correctly filled)
is it possible using repeater library to update this attribute or i need to add jquery developpment somewhere (library hack or out of the box ?)
below the html source code
<div data-repeater-list="group-a">
<!-- repeater template -->
<div data-repeater-item style="display:none;">
<label for="date">Date</label>
<input type="date" name="date" />
<span class="error_message" data-validate-for="date"></span>
<label for="amount">Amount</label>
<input type="text" name="amount" />
<span class="error_message" data-validate-for="amount"></span>
<input data-repeater-delete type="button" value="delete" />
</div>
<!-- first group displayed -->
<div data-repeater-item>
<label for="date">Date</label>
<input type="date" name="date" />
<span class="error_message" data-validate-for="date"></span>
<label for="amount">Amount</label>
<input type="text" name="amount" />
<span class="error_message" data-validate-for="amount"></span>
<input data-repeater-delete type="button" value="delete" />
</div>
</div>
expected values after user adding item
<!-- first group displayed -->
<div data-repeater-item>
<label for="date">Date</label>
<input type="date" name="group[1][date]" />
<span class="error_message" data-validate-for="group[1][date]"></span>
<label for="amount">Amount</label>
<input type="text" name="group[1][amount]" />
<span class="error_message" data-validate-for="group[1][amount]"></span>
<input data-repeater-delete type="button" value="Supprimer" />
</div>
thanks by advance
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
How to add a custom validation message for the required field?
Go to Everest Forms > Settings > Validation. Now, add the message in the 'Required' option's input box.
Read more >Set custom HTML5 required field validation message
Validation messages I want like. Required field: Please Enter Email Address Wrong Email: 'testing@.com' is not a Valid Email Address. (here, entered email ......
Read more >Client-side form validation - Learn web development | MDN
Go to any popular site with a registration form, and you will notice that they provide feedback when you don't enter your data...
Read more >Form required attribute with a custom validation message in ...
Example: This example shows how to do HTML form required attribute along with setting custom validation message.
Read more >How to Add Custom Validation Messages to Registration Form ...
Go to Content >> Form Fields >> Edit Field >> Advanced >> Custom Validation Message. Add Custom Validation Messages to Registration Form Fields....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i hack the jquery.repeater.js a bit by adding this code (looking for adding by Pat-Och below)
in repeater.js
you validate your input data as usual, in the controller method which receives the input of your form. display with your debug tool the content of the input and you will see.