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

Form Validation #386

Open
ashbaldry opened this issue Oct 18, 2021 · 0 comments · May be fixed by #389
Open

Form Validation #386

ashbaldry opened this issue Oct 18, 2021 · 0 comments · May be fixed by #389
Assignees

Comments

@ashbaldry
Copy link
Contributor

The {shinyvalidate} package doesn't seem to work with {shiny.semantic}. However Fomantic UI has out of the box form validation. It would be good to include this in the package.

I've been working on a POC of this, by being able to add the validation at the end of a form. It also includes a submission button, that will only trigger reactive events if the form passes validation.

Example:

  library(shiny)
  library(shiny.semantic)

  ui <- semanticPage(
    form(
      id = "form",
      field(
        tags$label("Name"),
        text_input("name")
      ),
      field(
        tags$label("E-Mail"),
        text_input("email")
      ),
      form_validation(
        id = "form",
        field_valitaion("name", field_rule("empty"))
        field_valitaion("email", field_rule("empty"), field_rule("email"))
      )
    )
  )

  server <- function(input, output) {
  }

  shinyApp(ui, server)
127.0.0.1_4395.and.3.more.pages.-.Personal.-.Microsoft.Edge.2021-10-18.18-53-00.mp4
@ashbaldry ashbaldry linked a pull request Oct 24, 2021 that will close this issue
11 tasks
@scizmeli scizmeli assigned scizmeli and unassigned scizmeli Feb 13, 2022
@scizmeli scizmeli self-assigned this Apr 5, 2022
@esraay esraay assigned esraay and unassigned scizmeli Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants