Renato Galvones
Renato Galvones

Reputation: 555

Foundation 6 Abide not working with Ajax / Dynamic Html

This problem is really annoying me.

In this simple form:

<form data-abide novalidate method="POST">
  <label>First name
  <input type="text" name="firstname" required> 
  </label>
  <input type="submit" value="Save">
</form>

I'm trying to add a new field and make Foundation check it.

$('<label>Last Name<input name="lastname" type="text" required></label>').insertBefore('input[type=submit]').foundation();

Example here: https://jsfiddle.net/wcLmb3y9/

Upvotes: 1

Views: 1249

Answers (1)

Renato Galvones
Renato Galvones

Reputation: 555

Found it guys!!!

Just add a

Foundation.reInit('abide');

Right after the html you've included and vóila!

Hope it helps more guys!

lml

Upvotes: 6

Related Questions