Yapapaya / jquery-cloneya

A jquery plugin to clone DOM elements
MIT License
76 stars 28 forks source link

Check box and radio button element's values are reset. #38

Closed sakthiemail closed 9 years ago

sakthiemail commented 9 years ago

We are using the form with radio and check box button. When we cloned the form, it reset the value of check box and radio buttons. It allows only one radio button value to choose for all the cloned forms.

Appropriate support or help is appreciated.

gchokeen commented 9 years ago

It allows only one radio button because radio button name all same for full form. You need to change the name in array format (eg: <input type="radio" name="name[1]"/>) . Don't worry about name index, cloneya handles internally!

Radio and checkbox getting reset, because valueClone option is false in default. You can set valueClone:true to keep the old selection when cloning the form. If don't want to clear the value for one specifc field in form we have super class noEmpty. simply add this class to your check/radio box cloneya will not reset that value.

unfortunately super class noEmpty not yet documented!

sakthiemail commented 9 years ago

Thank you for your reply. let I will check and inform you.

michelpellegrinq commented 1 year ago

For me is not working, when I clone my form the radio button keeps the exactly same name. Is there another way to clone radio buttons.