Skip to content

Is it possible to apply livevalidation to classes for multiple dynamically created inputs? #22

Description

@oshihirii

Scenario

I have an input which can be cloned and only has a class to identify it (as there cannot be more than one id with the same name).

I am trying to apply the Presence and Numericality constraints to the input, but it's not working because I am trying to use a class and not an id. Are there any ways around this?

What I've Tried

var myVariable = new LiveValidation('.my_class', { validMessage: 'valid input', wait: 500});
myVariable.add(Validate.Presence, {failureMessage: "required field"});
myVariable.add( Validate.Numericality );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions