I'm using razor page to build my application
and i'm stucking with a situation in form validation that is :
i have create a one page that contains many input fields,
one of them is mobile number
and for this field it should be maximum 10 digits and it is required,
and for that form, there are two buttons,
one is for submitting the form only if all the fields is valid,
and the second button is for 'save for later', here also all fields must be valid
except the required attribute it's optional,
i mean for mobile number field, it's okay if it is empty but it should display an error if it exceed 10 digits.
i know i can use different pages with different view models and validation but i want to handle it in one page.
so what is the best way to handle this situation?