mdelrosso / sheepit

SheepIt! Form Cloning plugin for Jquery
http://www.mdelrosso.com/sheepit/
MIT License
68 stars 44 forks source link

Support HTML5 input types #26

Open kschu91 opened 10 years ago

kschu91 commented 10 years ago

Currently there is no support for HTML5 input types like "date", "email", "color" etc. Here is a complete list of that types: http://www.w3schools.com/html/html5_form_input_types.asp

Currently I added the support on my own and implement the following in the "fillFormField" function:

var valueTypes = [ 'hidden', 'password', 'text', 'color',
    'date', 'datetime', 'datetime-local', 'email', 'month',
    'number', 'range', 'search', 'tel', 'time', 'url', 'week' ];
if ($.inArray(type, valueTypes)) {
    field.attr('value', value);
    return true;
}

Would be nice to have that in future releases :)

By the way: Very nice Plugin! Saved me a lot of time.