79653547

Date: 2025-06-04 21:57:12
Score: 0.5
Natty:
Report link

If your purpose is to display a custom invalid email message. you only need to add data-val-email="Custom messege" in input field. Here is the updated form.It works with jquery.validate.js and jquery.validate.unobtrusive.js.

<form id="myForm">

<input id="email" type="email" name="email" data-val="true" data-val-required="Email cannot be empty" data-val-email="Please add valid email">&nbsp;<span style="font-size: smaller; color: red" data-valmsg-for="email" data-valmsg-replace="true"></span>
<button id="btnconfirm" class="button" type="submit">Confirm</button>

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Muhammad Zeeshan