Validate code availability in form for better usability