use js to check form first