0

Is there any way to disbale jquery validation on certain input fields inside a form? So that it won't bother me with the 'red text under my input' or whenever I submit my form. I'm searching for a while now but without any succes. I tried using formnovalidate="formnovalidate" from this questions but also without any succes.

Here's my cshtml input code:

                <div class="form-group">
                    <label asp-for="preExposure" class="control-label"></label>
                    <input asp-for="preExposure" id="preExposureInput" class="form-control" type="text"/>
                    <span asp-validation-for="preExposure" class="text-danger"></span>
                </div>
A.Vandijck
  • 59
  • 1
  • 8
  • This is pretty similar to this question: https://stackoverflow.com/questions/19016053/turn-on-off-jquery-validation-for-one-input – HaroldP1 May 25 '20 at 21:04

1 Answers1

0

Although I posted as a comment that it was pretty similar to the linked question, the most important part of that answer is below:

Once you have the jquery validation turned on for the form with the .validate() you can still configure the rules for the individual element that you want, and remove all the rules.

$('#myfield').rules('remove'); // removes all rules for this field

HaroldP1
  • 31
  • 7