Validation for add page modal

Fixes https://github.com/Connexions/webview/issues/808 and https://github.com/Connexions/webview/issues/809
I'm curious why this is broken out as a global helper, since its code appears to apply to really only one use case.  If it's not an abstraction that can be used by multiple views, it should probably just be moved into the view that needs it.