maxatwork / form2js

Javascript library for collecting form data
http://maxatwork.github.com/form2js/
MIT License
640 stars 137 forks source link

Support for fieldset `name` attrribute #8

Closed zanona closed 13 years ago

zanona commented 13 years ago

Apparently HTML5 provides this new fieldset name attribute where it is possible to inherit input values to its fieldset parent like:

<input name='event'>
<fieldset name='ticket'>
    <input name='price'>
    <input name='name'>
    <input name='description'>
</fieldset>

and in theory this would return:

where _ is some unknown separator

?event=test&ticket_price=75.00&ticket_name=test&ticket_description=description

I'm not sure if this is completely correct since it seems no browser implements this yet, but it is definitely a convenient way to format data . ;)

zanona commented 13 years ago

Actually, perhaps this should be handled by a external polyfill or something like it, and then use form2js to handle the correct information, only, sorry..didn't realise this before.