diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index f250442..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -JavascriptFormValidator \ No newline at end of file diff --git a/.idea/JavascriptFormValidator.iml b/.idea/JavascriptFormValidator.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/JavascriptFormValidator.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml deleted file mode 100644 index b8387eb..0000000 --- a/.idea/jsLibraryMappings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index eabe228..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index c82afdc..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml deleted file mode 100644 index 9338ba6..0000000 --- a/.idea/watcherTasks.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/README.md b/README.md index 49ee820..7d110a5 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,20 @@ Then Integrate your form with Validator. @@ -44,7 +48,7 @@ It has automated listener to eliminating unnecessary changes on form. 2. Input Fields should specify the type of validation. - //***************For General Input Validation************************************** + ////////////////////For General Input Validation//////////////////////////////////////// // For Simple Require. @@ -61,17 +65,17 @@ It has automated listener to eliminating unnecessary changes on form. // For Password Match Validation. - //***************For Select Validation******************************************* + ////////////////////For Select Validation//////////////////////////////////////////// //For Simple Required - //***************For Textarea Validation******************************************* + ////////////////////For Textarea Validation////////////////////////////////////////// // For Simple Required @@ -111,7 +115,7 @@ So **No Need** to use ```` display: inline !important; } -###License +### License MIT License diff --git a/src/js/formValidator.js b/src/js/formValidator.js index f5674c9..0de3fbd 100644 --- a/src/js/formValidator.js +++ b/src/js/formValidator.js @@ -6,10 +6,15 @@ var form = { // TODO: Simplify the "TextArea" Validation. validate: function (form) { + // For Basic Element Selection. var form_el = document.getElementById(form); + // For Normal Textboxes. var st_form_inputs = form_el.getElementsByTagName('input'); + // For Textareas. var st_form_textArea = form_el.getElementsByTagName('textarea'); + // For Select or Drop Down Box. var st_form_select = form_el.getElementsByTagName('select'); + // For Labels. var st_form_labels = form_el.getElementsByTagName('label'); console.log(st_form_inputs); @@ -173,7 +178,7 @@ var form = { // Basic Field Empty Validation. - if (field_value == 0) { + if (field_value == '-') { response = label_core + ' ' + 'Choose valid Option ';