onInputChange(e, 'name')} required autoFocus className={classNames({ 'p-invalid': submitted && community.name==='' } )} />
- {submitted && community.name==='' && Nombre es requirido.}
+ {submitted && community.name==='' && Nombre es requirido.}
@@ -253,9 +259,9 @@ const Communities = () => {
-
+
- {submitted && !community.province && Provincia es requirido.}
+ {submitted && (!community.province || community.province === '') && Provincia es requirido.}
@@ -267,7 +273,7 @@ const Communities = () => {
- {submitted && !community.canton && Cantón es requirido.}
+ {submitted && !community.canton && Cantón es requirido.}
@@ -279,7 +285,7 @@ const Communities = () => {
- {submitted && !community.district && Distrito es requirido.}
+ {submitted && !community.district && Distrito es requirido.}
@@ -289,9 +295,9 @@ const Communities = () => {
- onInputChange(e, 'phone')} required autoFocus className={classNames({ 'p-invalid': submitted && !community.phone } )} />
+ onInputChange(e, 'phone')} required autoFocus className={classNames({ 'p-invalid': submitted && community.phone==='' } )} />
- {submitted && community.phone==='' && Número de teléfono es requirido.}
+ {submitted && community.phone==='' && Número de teléfono es requirido.}
@@ -303,7 +309,7 @@ const Communities = () => {
onInputChange(e, 'num_houses')} required autoFocus className={classNames({ 'p-invalid': submitted && community.num_houses < 1 } )} />
- {submitted && community.num_houses < 1 && Número de viviendas es requirido y debe ser mayor que 0.}
+ {submitted && community.num_houses < 1 && Número de viviendas es requirido y debe ser mayor que 0.}