Interested in adding HTML5 input type support/some other tweaks.

21 views
Skip to first unread message

Nathan Rice

unread,
Nov 16, 2011, 10:03:34 AM11/16/11
to FormAlchemy
Hi,

I am currently using Form Alchemy, and I would like to add client side
validation. By far the nicest client side validator is part of jQuery
tools. Because it looks at the HTML5 input types to help configure
validation, I need to go back and change the type field on the
generated html. I would prefer to just update the Field type when I
create the form initially, it would be easier and cleaner. To that
end I have forked your FA github repo. Is there anything I can update
In addition to new Field methods/default renderers that will expedite
getting my changes merged back into mainline?

Additionally, given the idea of Clob/Text fields as unlimited length,
they should probably default to textarea instead of text input.
Comments/concerns?

Thanks,

Nathan

Gaël Pasgrimaud

unread,
Nov 16, 2011, 5:36:43 PM11/16/11
to forma...@googlegroups.com
Hi,

On Wed, Nov 16, 2011 at 4:03 PM, Nathan Rice
<nathan.ale...@gmail.com> wrote:
> Hi,
>
> I am currently using Form Alchemy, and I would like to add client side
> validation.  By far the nicest client side validator is part of jQuery
> tools.  Because it looks at the HTML5 input types to help configure
> validation, I need to go back and change the type field on the
> generated html.  I would prefer to just update the Field type when I
> create the form initially, it would be easier and cleaner.  To that
> end I have forked your FA github repo.  Is there anything I can update
> In addition to new Field methods/default renderers that will expedite
> getting my changes merged back into mainline?

I suggest to:

- add some new field types in fatypes for html5 inputs ( class
Email(String): pass)

- add some default renderers for those types

- add a helper to changes html_options (which is used to add some html
attributes to the field)

field.set(attrs={'placeholder': 'Foo'})
field.attrs(placeholder='Foo')

The last point is not really useful but I'm tired to use html_options :)

Btw any effort is always appreciated. I was thinking about html5
renderer a few days ago. But the best way to get stuff merged in
master is to run the regression tests before pull and add some tests
for the new stuff :)

>
> Additionally, given the idea of Clob/Text fields as unlimited length,
> they should probably default to textarea instead of text input.
> Comments/concerns?
>

Why not. It's easy to change a default renderer and this will probably
break some tests but it make sense. I'm +0


> Thanks,
>
> Nathan
>
> --
> You received this message because you are subscribed to the Google Groups "FormAlchemy" group.
> To post to this group, send email to forma...@googlegroups.com.
> To unsubscribe from this group, send email to formalchemy...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/formalchemy?hl=en.
>
>

Nathan Rice

unread,
Nov 16, 2011, 7:13:01 PM11/16/11
to forma...@googlegroups.com
I put in a pull request on github that takes care of most of that. I
didn't do the helper that you mentioned, but I did update your test
suite :)
Reply all
Reply to author
Forward
0 new messages