Validation for add page modal

Fixes https://github.com/Connexions/webview/issues/808 and https://github.com/Connexions/webview/issues/809
It's generally best practice (although I'm guilty of not doing it myself) to have a method that handles the event and extracts whatever information you need, and then a separate method that actually acts on that data (like for validation).  This makes it much easier to write tests to make sure the validation works, for example, without the need to recreate a submit event.