What is the best way to handle having a form in the content, but the submit/save button in the footer? For example, I’d like to have something like this:
I don’t know best practices, but one solution would be to set the ``[disabled] property of the button to be true whenever the form validators are not all true.
I try to only do that on very small forms, because if the form has to scroll, sometimes the invalid field isn’t in view and it can be confusing for the user to figure out what’s wrong. My typical idiom is to have a touchedAndInvalid method in the component that can be used to trigger error classes and messages in the template. Then I put a submitAttempted boolean in the component which makes touchedAndInvalid consider all controls to have been touched. The submit function checks if the form is valid, and if not, sets submitAttempted to true and returns immediately. This will cause all error conditions on missing required fields to pop.
I like your structure @rapropos. I’ll tell you though, my biggest challenge (and there are a lot) in this new Ionic world is designing useful UI pages that require no scrolling on any recent device. Now I’m wondering if your structure could be better even if no scrolling is needed, for example in the case of security information you’d want to erase quickly, like CCV numbers.
It is not a good option to have a form in footer section. Although it is feasible to implement form in Footer, however it is not a good user perspective to have form in footer section.
The TestForum is empty in the footer so anytime the input has a value it fails with "Cannot read property ‘controls’ of undefined. The footer doesn’t see the form.
I made a suggestion in the second post of the thread. The answer to why it couldn’t be adopted was validation. As your example seems to be disavowing validation, is there another reason why you cannot follow that suggestion and just make your button in the footer an ordinary button?