question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

An ability to check is form valid or not

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

For e.g. I want to display a form for user and be able to toggle an disabled prop of submit button if form is valid or not.

What does the proposed API look like?

It would be super if it would be possible to do by using accessing this boolean value like a form prop like:

this.props.form.isValid

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

22reactions
domjancikcommented, Sep 2, 2021

Is there a way to validate the form like validateFields() that does not end up showing error messages next to the form fields?

I am trying to continually know whether the form is valid or not and disable the submit button accordingly.

20reactions
ealiagacommented, Sep 28, 2020

In my case, I use the Form within a Modal and the submit of the form is done with the button in the footer of the Modal, therefore to know if the Form is valid I use the following:

const [form] = Form.useForm()

const isFormValid = () => form.getFieldsError().some((item) => item.errors.length > 0)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Form Validation: Why It Matters and How to Get It Right - CXL
Form validation is a “technical process where a web-form checks if the information provided by a user is correct.” The form will either...
Read more >
Client-side form validation - Learn web development | MDN
Client-side validation is an initial check and an important feature of good user experience; by catching invalid data on the client-side, the ...
Read more >
how to check if a form is valid programmatically using jQuery ...
Use .valid() from the jQuery Validation plugin: $("#form_id").valid();. Checks whether the selected form is valid or whether all selected elements are ...
Read more >
Validating Input | Web Accessibility Initiative (WAI) - W3C
Validation should aim to be as accommodating as possible of different forms of input for particular data types. For example, telephone numbers are...
Read more >
Form Validation | validate form input before submitting the data
If you've learnt your functions properly, you should be able to guess that our function will return a Boolean value — either true...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found