Data share between widgets OR getting form validation in fie

Posted by Freer on 05-Dec-2019 18:21

I'd like the server side form validation to display any validation error for each field with that field, rather than simply raising a single message for the form. 

I have two ideas but can't figure out either: 

1. Do the validation in the individual field. Which I can do easy enough, but I can't find how to tell if the form is being submitted or just rendering the page. So every required field automatically fails on initial page creation because it has no value. The FormController has a ShouldProcessRequestKey bool it checks, but I can't figure out how to access that a the field level. 

2. Read the validation from the form in each individual field. It appears that the FormController just adds those to the ViewBag for the form, which I can't seem to get at in the field widgets. 

Has anyone gotten something like this to work? 

All Replies

This thread is closed