Skip to content

Commit

Permalink
Minor Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bietkul committed Sep 22, 2017
1 parent ec30c08 commit 3d60069
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"react-native-form-builder",
"version":"1.0.8",
"version":"1.0.9",
"description":"Generate Awesome Forms In an easy way",
"main":"src/index.js",
"scripts":{
Expand Down
6 changes: 3 additions & 3 deletions src/utils/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ export function autoValidate(field) {
let errorMsg = '';
if (field.required) {
switch (field.type) {
case 'text':
case 'email':
if (isEmpty(field.value)) {
error = true;
errorMsg = `${field.label} is required`;
} else if (!isEmail(field.value)) {
error = true;
errorMsg = 'Please Enter a valid Email';
errorMsg = 'Please enter a valid email';
}
break;
case 'text':
case 'url':
case 'password':
if (isEmpty(field.value)) {
Expand All @@ -39,7 +39,7 @@ export function autoValidate(field) {
error = true;
errorMsg = `${field.label} is required`;
} else if (isNaN(field.value)) {
errorMsg = `${field.label} Should be a number`;
errorMsg = `${field.label} should be a number`;
}
}
break;
Expand Down

0 comments on commit 3d60069

Please sign in to comment.