Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radiobuttons type does not show passed value #308

Closed
mw777eds opened this issue Dec 21, 2020 · 3 comments
Closed

radiobuttons type does not show passed value #308

mw777eds opened this issue Dec 21, 2020 · 3 comments
Labels

Comments

@mw777eds
Copy link

mw777eds commented Dec 21, 2020

When passing data into the form via the value key, the "radiobuttons" type does not show the data. This does work if you change the type to "radios".

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Getting started with JSON Form</title>
    <link rel="stylesheet" type="text/css" href="deps/opt/bootstrap.css" />
    <style></style>
  </head>
  <body>
    <h3>Requests and Issues Settings</h3>
    <form></form>
    <div id="res" class="alert"></div>
    <script type="text/javascript" src="deps/jquery.min.js"></script>
    <script type="text/javascript" src="deps/underscore.js"></script>
    <script type="text/javascript" src="deps/opt/jsv.js"></script>
    <script type="text/javascript" src="lib/jsonform.js"></script>
    <script type="text/javascript">
          $('form').jsonForm({
              "schema":{
                "email":{
                  "type":"object",
                  "properties":{
                    "securityOptions":{
                      "type":"string",
                      "title":"Security Options",
                      "enum":["Off","SSL","TLS"]
                    }
                  }
                }
              },
              "form": [
                {
                  "type": "submit",
                  "title": "Save"
                },
                {
                "type": "fieldset",
                "expandable": true,
                "title": "Email Settings",
                "items":
                  [
                    {
                      "key":"email.securityOptions",
                      "type":"radiobuttons",
                      "prepend":"Security Options",
                      "notitle":true,
                      "activeClass": "btn-success"
                    }
                  ]
                }
              ],
                onSubmit: function (errors, values) {
                  if (errors) {
                    $('#res').html('<p>I beg your pardon?</p>');
                  }
                  else {
                    alert (JSON.stringify(values));
                  }
                },
                "value":{
                  "email":{
                    "securityOptions":"TLS"
                    }
                }
            }
      );
    </script>
  </body>
</html>
@tchapi tchapi added the Bug label Dec 22, 2020
@tchapi
Copy link
Member

tchapi commented Dec 22, 2020

As I see it, it's just the class that is missing on the Bootstrap button. I'll issue a fix soon.

@tchapi
Copy link
Member

tchapi commented Jan 13, 2021

Hi @mw777eds

I think this has been fixed by 6ae9ebf

Can you confirm and close the issue if it's good for you ?
Thanks,
BR

@tchapi
Copy link
Member

tchapi commented Feb 18, 2021

Closing as this has been fixed already. Please reopen if you still have the problem

@tchapi tchapi closed this as completed Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants