How can I restrict form submission using condition?