validation and save data in prev click.

validation and save data in prev click.