GithubHelp home page GithubHelp logo

Comments (4)

brainfoolong avatar brainfoolong commented on June 10, 2024 1

Maybe special value like boolean true/false could work as check/uncheck in this case but i'm not sure to add different behaviour depending on the value.

from form-data-json.

brainfoolong avatar brainfoolong commented on June 10, 2024

Thank you for your pull request. I came across this specific case in my tests and the current behaviour is exactly that what i wanted. It should only set the checkbox to true when the actual value is the same as the provided one.

The reason is simple: The data what you can get from .formToJson should set exactly the same with .fillFormFromJsonValues.

Imagine when you swap checkboxes in dom and they have no specific array key like name=ids[] than you definitely not want to set to true when the value doesnt match.

from form-data-json.

imp-dance avatar imp-dance commented on June 10, 2024

Fair enough, I just figured I'd let you know incase the behaviour wasn't expected. I saw that there were no checkboxes in the demo either, so I though it might've slipped between the gaps.

from form-data-json.

brainfoolong avatar brainfoolong commented on June 10, 2024

Nice catch. Thank you, i should add checkboxes to the demo as well. In the real TestSuite at https://brainfoolong.github.io/form-data-json/tests/test.html there are all possible inputs.

from form-data-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.