Unchecked checkbox show up as checked
See original GitHub issueI have the following schema for checkbox:
{
type: "checkbox",
label: "Terms and Conditions",
model: "terms",
default: false
}
When I save the form, it posts the string “false” to the server.
So when the data is read from the server and the response is assigned to the model (ex. when editing an existing form), the component interprets “false” as truthy (strings are truthy) and makes the checkbox ticked.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
check / uncheck checkbox using jquery? - Stack Overflow
An element is considered checked as long as it has the attribute of checked even if it has no value or the value...
Read more >How do I check/uncheck a checkbox input or radio button?
You can check or uncheck a checkbox element or a radio button using the .prop() method: 1. 2. 3. 4. 5. // Check...
Read more >How to Check/Uncheck CheckBoxes in a Page using jQuery ...
Today, I'll show you how to check or uncheck a particular checkbox using jQuery, one of the most popular JavaScript frameworks. jQuery provides...
Read more >How to Check or Uncheck A Checkbox Dynamically Using ...
Answer: Use the jQuery prop() method. You can use the jQuery prop() method to check or uncheck a checkbox dynamically such as on...
Read more >JavaScript Checkbox
A checkbox has two states: checked and unchecked. ... select one or more checkboxes and click the button, it'll show the values of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can define a “get” method in schema, where you can convert the model value.
@sjordan1975 You are welcome to implement the result of your philosophical software design/development discussion into a PR. In the meantime, I’m closing this issue.