Validate form input both for submit and preview.