How to preview inputs before submitting the form?