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

Input radio are not restored #3

Open
leozero opened this issue Sep 17, 2014 · 7 comments
Open

Input radio are not restored #3

leozero opened this issue Sep 17, 2014 · 7 comments

Comments

@leozero
Copy link

leozero commented Sep 17, 2014

I have a form and I decoy it to print it in a popup, but wehn I restore it, the radio input are not checked.

PS : Thanks for your work.

Ubuntu 14.04 - Chrome 38

@haggen
Copy link
Member

haggen commented Sep 17, 2014

Thanks for bringing it to my attention, I'll definitely look into it.

But about your particular case, I'm sensing that Decoy may not be the best option, do you mind telling me what exactly are you trying to accomplish ?

@haggen
Copy link
Member

haggen commented Sep 17, 2014

Oh I see, you're trying to move the form to another place and then use restore to make it get back to the original place. Well, the inputs are going to be empty for sure. Decoy saves de original from harm, that's the point of this plugin. Then everything you did to the copy is undone when restoring the original.

If you're simply trying to move the form around, you could use #detach then #append back and forth.
But if you want the changes made to the copy to affect the original once you're done, you better #clone the original and then #clone back the copy. See more on jQuery's manipulation methods.

Let me know if this helps you.

@leozero
Copy link
Author

leozero commented Sep 17, 2014

Thanks for your help. I had trouvle with the clone function, the content of textarea was not copied. But with your plugin everything is restored (with the good values for textarea, input text and checkbox) except the radio buttons. But it helps me a lot ;-). I will look your link and I think I will found a solution.

@haggen
Copy link
Member

haggen commented Sep 17, 2014

Hey, I think I found something, take a look at this: http://jsfiddle.net/6qvmgffn/

Fill the form up then click "Duplicate this". The example is pretty straight forward, I used #clone and then #replaceWith on a placeholder, here on Safari 7 it worked, even the radio button maintained its value.

@haggen
Copy link
Member

haggen commented Sep 17, 2014

Anyway, I'm going to let the issue open until I look into why radio buttons are being restored blank, again thanks for the report!

@leozero
Copy link
Author

leozero commented Sep 17, 2014

Wow, thanks for your help. It works now.

You was very helpful (and sorry for my awful english, I'm french ^^")

@haggen
Copy link
Member

haggen commented Sep 17, 2014

You're most welcome! And don't be sorry at all, English isn't my native tongue either, I'm Brazilian :-)

@haggen haggen closed this as completed Jan 22, 2018
@haggen haggen reopened this Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants