Search code examples
jqueryspringspring-mvcjquery-validatespring-webflow

Spring form with JQuery validation


I am trying to add jquery validations to an exisitng spring form.

The issue is in spring form if you have following

<form:input size="60" path="contact.emailAddressTxt"/>

The HTML generated is

<input id="contact.emailAddressTxt" type="text" size="60" value="" name="contact.emailAddressTxt">

If you observe the value for name and id gets genearated. In Jquery validate plugin when I try to set rules using the generated names, it fails to load. In Jquery I cannot use contact.emailAddressTxt

So how do I validate such input fields using jquery validate plugin?


Solution

  • The escape character is \\ and not a single . The following code worked

    $("#contact\\.emailAdressTxt")