Question

I can't tell what I have done wrong here.

This part seems to be working, or at least it fires, because a breakpoint set with the debugger breaks in the code.

<script>
    jQuery("#contactForm").validationEngine();
</script>

But it doesn't seem to be hooked up to the form fields and doesn't attempt to validate, or validates improperly, when used like this:

<form class = "contactform" id = "contactForm">
    <fieldset>
        <div class="contactform-email contactform-field">
            <label class="contactform-label" for="contactform-email">Email Address:
                <br>
            </label>
            <input class="validate[required,custom[email]] contactform-input" type="email" id="contactform-email" name="email" />
        </div>
        <input class="contactform-button" type="submit" name="submit" value="Send"/>
    </fieldset>
</form>

Is there something I've mis-configured?

Bob

Was it helpful?

Solution

OK, I finally solved it.

The thing is that this code is running within the Meteor JavaScript framework and it expects code such as

jQuery("#contactForm").validationEngine();

To be in a Template.myTemplate.rendered function to execute properly and at the right time.

Still learning...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top