Posted: May 18, 2015 at 8:06 pm
|
I’m using EE 3.1.36.6.P, and the copy to all forms button isn’t copying the value of my gender field, which is radio buttons. I have a few other fields that are radio buttons that do get copied, but they each only have one radio button (actually, they should be checkboxes, but we tried switching them to radio buttons because we’re also having problems with form validation – they are required fields yet somehow people are getting through registration without checking them sometimes.) Any idea why this might be failing? I looked in espresso_cart_functions.js and don’t see any obvious reason right off why it might be ignoring that field, but admittedly, I don’t understand the jQuery code all that well. |
|
Also, if I wanted to hide my secondary question groups after the “copy to all forms” button is clicked, I would need to add that code to the function in espresso_cart_functions.js, right? Has anyone ever tried to do that? We have families registering multiple children for many classes (events) at once, so our registration form gets VERY long. Anything I can do to simplify it would be very helpful. Thanks! |
|
Hi, Thanks for reporting this, it looks liek a bug. I’ve raised a developer ticket to fix it. Regarding the hiding, you could do it from a site specific plugin (rather than modifying core files) that loads custom jquery onto the event registration page. As this is very specific to your use case, you would need a developer to assist with the customisation. |
|
I fixed the problem by editing espresso_cart_functions.js. I put this code in under the “jQuery(‘.copy-all-button’).on( ‘click’, function() {” (not sure exactly what line it was because I had already made other edits to this file): switch (input_type) { ... case 'radio': // make sure the whole radio group is looked at, not just the first button in the array var genders = document.getElementsByName(copy_field_name); for(var i = 0; i < genders.length; i++) { if(genders[i].checked == true) { selectedGender = genders[i].value; //console.log("found selected value: " + selectedGender); if (jQuery(this).val() == genders[i].value) { jQuery(this).attr("checked", "checked"); } } } I also figured out how to add the jQuery calls to hide the relevant fields when the copy-all button is clicked and the first instance of my fields is completed. In case it helps anybody else out, here’s the idea: var firstrelease = jQuery("input[value='I accept the Release and Waiver.']:first"); if (firstrelease.attr("checked") == "checked") { var waiverfields = jQuery("fieldset[id='releasewaiver-1366059124']:not(:first)"); waiverfields.hide(); } |
|
Thanks for sharing that! I added a *possible* fix to the ticket that is a little more general than yours:
That would also go under the radio case. It hasn’t been fully tested nor accepted yet, so use at your own risk. |
The support post ‘Copy above information to all forms not copying radio buttons’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.