Added Register button handeler and validateForm function