implement javascript to check page input values