Single JS method to render the form & show errors