Comments (7)
This is the browser applying the checked flag when the label is clicked on. The label for the checkbox group includes the 'for' attribute and the duplicate ids mean the event is forwarded to the first element of that id. The for attribute can be removed for toggles however there are other javascript errors seen in formBuilder when you have two checkbox fields with the same name.
@kevinchappell Removing the for attribute for toggles is simple enough, generates valid HTML and the toggles will work. However I don't believe we should be fixing any other duplicate ID issues since it is invalid markup.
from formbuilder.
Can you please provide a reproduction and some screenshots? I cannot replicate.
Is this with formBuilder or formRender?
from formbuilder.
Hi @lucasnetau
It's actually renderer issue, I wasn't clear
https://codepen.io/maysam-the-scripter/pen/poBybPK
here is a demo, when you try to toggle the checkbox in the second form, it toggles the ones in the first form
it works fine when checkbox is not in toggle mode though
from formbuilder.
You have the same ID for the control in both forms. So the selector is picking up the first control of that ID. Please adjust your form control ids so that you have valid HTML.
from formbuilder.
when this need to be localized, also this is only happening for the toggle, and other fields don't have this problem
in my application, I am rendering same form 4 times and this problem only happens when I turn on the toggle for checkboxes
from formbuilder.
We can investigate if the selector can be reduced to target the expected control.
However it still holds that duplicate IDs in a single HTML page is invalid and you cannot expect anything to work. Giving a unique name in the formData JSON prior to render is a quick method (Array.map and append form-- to the name of each control field)
from formbuilder.
Related Issues (20)
- If i give large Text for header component in my form builder, UI is getting disrupted. There is no way to limit the length as header component does not p HOT 2
- How do i give range to my date field, i am not able to do it from the UI HOT 3
- how to custom remove, update, add field Specific HOT 5
- I want to change the date format HOT 1
- form builder elements label issue. HOT 2
- Issue setData HOT 10
- I am trying to print my form which has an HTML5 date picker, even if the format is dd-mm-yyyy after i initiate the print, the date is coming in reverse order, i.e., yyyy-mm-dd. HOT 3
- Custom attributes value is not set on edit only default value is populated HOT 1
- formBuilder not restoring typeUserAttr select value on setData HOT 26
- TinyMCE fields don't load userData HOT 2
- Downloading ZIP or TAR Windows reports Virus HOT 6
- Error label value set data HOT 7
- Grouping controls HOT 10
- How To selected setData element select multiple HOT 2
- Restrict elements in form builder. HOT 1
- How to get HTML code in formBuilder using react HOT 1
- Multiple Form Render Issue HOT 1
- Inline Controls HOT 2
- ASP core mvc / blazor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formbuilder.