Validayion is applied in form elements using Javascript