0

I have a pretty large form section (< form runat="server" >) in my .aspx. In this section I have multiple elements, html and < asp: > elements.

The form by itself runs ok until I try to get parsley to validate the items in there. Basically it seems that having a form inside a form is not possible with parsley, even though it runs without issues otherwise.

What happens is that the parsley function I found in the docs will not run correctly. I get as error in the console: enter image description here I have tried the basic example as mentioned in my link above in an almost empty .aspx page and the function in the picture runs fine and I can see the validation happening in the page same as in the example.

Is it possible to "mix" both forms as in my use case and have parsley do the validation or is parsley not usable in this particular case?

Many thanks in advance!

Just_Stacking
  • 395
  • 3
  • 13

1 Answers1

0

First I thought that the answer was: ASP.NET and Parsley don't mix at all, then I checked: Trigger parsley validation without submit form?

I found that when I put the following code at the top of my < script > section:

$('#YourInputIDHere').parsley().validate();

it works even better than initially thought, since then it becomes a real time validation. The related field remark will switch through: "This value is required."->"This value seems to be invalid." (upon first entry)-> "" (empty, if correct).

Now I just have to find out how to change the standard behavior from black to red and change the empty field to a green confirmation in case of success.

As a side note: I really hope that someone with the required experience would support the developer in making a better documentation for this tool. I think the value of this is lost to many people (especially beginners) because they cannot get it to run at all in the first place. I almost had to give up for time reasons. More use cases in addition to the existing very basic documentation would be great.

Just_Stacking
  • 395
  • 3
  • 13