bcardarella/client_side_validations — Issue #237: Presence is "Undefined" on Dynamic Nested Form
Author: cannaent
Created: 2011-12-11 00:55:51+00:00
State: open

I'm using 3.1.0 and am having a problem with a dynamic nested form. I am also using the multistep validation code posted in the wiki. If I remove the multistep validation it still occurs though.

Whenever a form field is dynamically created the validations are not created for that form field and the javascript console shows this error:

```javascript
Cannot read property 'presence' of undefined

validateElement rails.validations.js:107
$.fn.isValid rails.validations.js:76
e.extend.each jquery.min.js:16
e.fn.e.each jquery.min.js:16
f.event.handle jquery.min.js:17
f.event.add.i.handle.k
```

This occurs on any nested fields added dynamically. I tried calling .validate after each field creation but no dice.

So instead of using 3.1.0 I pulled the latest version from git and tried that. This fixes the dynamic nested field validation but entirely breaks the multistep form validation (at least the one posted in the wiki). So I had to go back to 3.1.0

Any help would be greatly appreciated!