Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existing form #62

Open
karellm opened this issue May 18, 2012 · 3 comments
Open

Existing form #62

karellm opened this issue May 18, 2012 · 3 comments

Comments

@karellm
Copy link

karellm commented May 18, 2012

A while ago, I started a fork of this rep to implement its features on existing form so it doesn't only generate forms but take existing ones and apply validation, plugins... (I can't really do a pull request as it was too long ago and it would be more complicated to merge than to rewrite the code).

Would you be interested in this feature? I'd be happy to write the code. It basically adds a el attribute - a jquery object or a selector - to the schema definition. So you can do any of this:

      schema: {
        name:      $('#foo'),
        email:     '#email',
        start:     { el:  $('#start') },
        end:       { el:  '#start' }
    }

It automatically detects what the input is and set the rest of the schema accordingly. Though it can be overwritten by being explicit in the schema definition.

@powmedia
Copy link
Owner

Sounds interesting. I'm in the process of refactoring some of the code so could be worth waiting until that's done before starting on this.

Any ideas on what the API for this would look like?

@karellm
Copy link
Author

karellm commented May 18, 2012

What exactly do you want to know about the API?

I've done it 6 months ago (when you had one single file). I broke the file into AMD modules back then and you can look at some ideas for the config here: https://github.com/karellm/backbone-forms/blob/master/exemple/config.js

The code in the repo may be broken and isn't the latest version but it will give you an idea of what I wanted to do.

@karellm
Copy link
Author

karellm commented Jun 13, 2012

@powmedia Can you give me an update on this? How is the refactoring going?

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

No branches or pull requests

3 participants