You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an EditForm with the Fluent Validation component and Im trying to figure out the best way to only enable the Submit button if the form is valid.
I can test to see if the form has been modified and if it is valid, which works fine, but what about if you load the form with data to use in an edit or update screen, and it is valid data? If you check for EditContext IsModified() and never modify it after it loads, the button will stay disabled when the page loads which then you have to make some kind of modification for the button to then be enabled.
What im experiencing is for a form that loads data to edit or update, if i set the button's disabled state to IsModified() || Validate(), the button will stay disabled until I make a change to the data.
If i take off the IsModified() and just leave the Validate() in there, the Validation fires and the messages show initially. I would think initially you would have the button enabled regardless for cases like these?
Is there a way to test for validation without showing the messages in the Validation Summary?
any ideas on how to best handle this scenario? Initial validation but do not show the validation messages.
I did see one other discussion similar to this but not exact.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have an EditForm with the Fluent Validation component and Im trying to figure out the best way to only enable the Submit button if the form is valid.
I can test to see if the form has been modified and if it is valid, which works fine, but what about if you load the form with data to use in an edit or update screen, and it is valid data? If you check for EditContext IsModified() and never modify it after it loads, the button will stay disabled when the page loads which then you have to make some kind of modification for the button to then be enabled.
What im experiencing is for a form that loads data to edit or update, if i set the button's disabled state to IsModified() || Validate(), the button will stay disabled until I make a change to the data.
If i take off the IsModified() and just leave the Validate() in there, the Validation fires and the messages show initially. I would think initially you would have the button enabled regardless for cases like these?
Is there a way to test for validation without showing the messages in the Validation Summary?
any ideas on how to best handle this scenario? Initial validation but do not show the validation messages.
I did see one other discussion similar to this but not exact.
Beta Was this translation helpful? Give feedback.
All reactions