It changes the radiogroup for all radio buttons, I need this code since I had to style the radion button individually. the code above works when copy pasted to the console on the staging link, but is not working when put on the custom code of the page settings, can anyone tell me what I am doing wrong here?
Custom code won’t work in the editor, but probably will work in the published app. Have you published your app and checked if its working on the live version of the app?
when you use the code in the console all the elements are rendered in the page, but on DOMContentLoaded they may not be present in the page. you may want to use the “on mounted” event on the elements that you want to access.
you can also set attributes directly in weweb
@dorilama I have tried setting attributes, but you can either put the attribute on the parent of the <input> or the label of the <input>, not on the input itself. Question though, where should I put the on mounted event? I have tried putting it on the Radio Group element and Form Container but custom code is still not running on the published site. the only one I have not tried is putting it on the Option element, but that is just the text of the radio button.
right. it looks like there is no control over the actual inputs, and because the name attribute is set by the vue component any modification that you do is probably undone by the next render of the component.
You may want to contact weweb’s team for this.
Hey @Beldion , more inforamtion would let people in this community - all volunteers - help you more in less time. I looked at your description and I don’t have quite enough information to figure out what your situation is, let alone give better advice than what you’ve received so far. You’re obviously thoughtful and responsive and want to get this problem solved. I recommend making a video showing the situation, applying the code, what works, what doesn’t.
Another alternative is to have a more interactive session via an office hours type model. You could bring to either weweb office hours (they are held every couple of weeks) or I hold office hours working on these kinds of hard low-code things just about every day on State Change.
Hi,
the radiogroup element have internal logic to set the name, which may regulary erased what you are doing with your script.
Can you explain me more about why you need to change the name? Maybe having an option to set it directly in the setting of the radiobutton will be a much more better solution
Hi Beldion,
I still do not see the link between style of the button and putting an attribute name on it? Can you explain me more what you are trying to achieve so i can help you better?
The default radio button cannot be styled the way we need it to be styled. Here is a comparison using 1 radio group element and 3 radio group. So the solution I thought of was to use 3 radio groups, style them individually then just manipulate the name of all 3 of them to a single one so that the user can only choose one radio button. Currently with me using 3 radio groups with 3 names. the user can select all 3 of them.