Skip to content

Commit d684cb4

Browse files
authored
NFSFU Form [email protected] (#7)
1 parent 108f681 commit d684cb4

10 files changed

Lines changed: 28 additions & 17 deletions

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [1.2.4] - 2023-08-26
4+
5+
### Changed
6+
- Improved the `ajax()` function for a more clean experience.
7+
8+
### Fixed
9+
- Fixed the issue of `custom ajax request body not sending in browser rather getting the form details.`
10+
311
## [1.2.3] - 2023-08-25
412

513
### Fixed

ReadMe.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ To use the library in your project, there are two ways to include NFSF234 Form V
5252
If you're looking to employ the form validation library in your browser environment, simply include the following URLs within the `<head>` tag of your HTML code:
5353

5454
```html
55-
<link rel="stylesheet" href="https://unpkg.com/[email protected].3/dist/css/nfsfu234FormValidation.min.css">
56-
<script src="https://unpkg.com/[email protected].3/dist/js/nfsfu234FormValidation.js"></script>
55+
<link rel="stylesheet" href="https://unpkg.com/[email protected].4/dist/css/nfsfu234FormValidation.min.css">
56+
<script src="https://unpkg.com/[email protected].4/dist/js/nfsfu234FormValidation.js"></script>
5757
```
5858

5959
This way, your browser-based project can readily harness the capabilities of the NFSFU234 Form Validation library. 🌐📦
@@ -70,11 +70,6 @@ If your preferred method involves npm, follow these simple steps to integrate th
7070
npm install nfsfu234-form-validation --save
7171
```
7272

73-
```bash
74-
npm install bcrypt --save
75-
76-
```
77-
7873
By executing this command, you're well on your way to enjoying the benefits of the NFSFU234 Form Validation library. 📦🚀
7974

8075
## 🏁 Initialization

dist/js/nfsfu234FormValidation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/nfsfu234FormValidation.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

images/IMG-d09df89sdfc0879sf08.png

-301 Bytes
Loading

images/x-logo.jpg

-4.98 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nfsfu234-form-validation",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "NFSFU234 Form Validation is a lightweight and user-friendly JavaScript library designed for validating HTML form elements, with a special emphasis on textarea fields. It offers customizable validation messages, comprehensive support for required field checks, seamless inline error displays, and convenient modal error notifications.",
55
"main": "dist\\js\\nfsfu234FormValidation.js",
66
"directories": {

src/js/nfsfu234-form-validation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -861,14 +861,14 @@ const bcrypt = require('bcryptjs');
861861

862862
let requestData ;
863863

864-
if (typeof window !== 'undefined') {
865-
// Get the form data using the `_getFormDetails` function
866-
requestData = this._getFormDetails(form);
867-
}
868-
else if (AJAXOptions && AJAXOptions['RequestBody'])
864+
if (AJAXOptions && AJAXOptions['RequestBody'])
869865
{
870866
requestData = AJAXOptions['RequestBody'];
871867
}
868+
else if (typeof window !== 'undefined') {
869+
// Get the form data using the `_getFormDetails` function
870+
requestData = this._getFormDetails(form);
871+
}
872872
else
873873
{
874874
requestData = '';

test/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ <h1>Signup Form Test</h1>
171171
}
172172
formValidator.restrictInputLengthWithCounter( form.querySelector('textarea') );
173173

174+
formValidator.hashPassword('@Password123')
175+
.then( hashedPassword =>{
176+
console.log(hashedPassword);
177+
})
178+
.catch( (error)=>{
179+
console.error(error);
180+
} );
181+
174182
</script>
175183

176184
</body>

web/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<link rel="stylesheet" href="assets/css/style.css">
88

99
<!-- Load NFSFU234FormValidation Library -->
10-
<script src="https://unpkg.com/[email protected].3/dist/js/nfsfu234FormValidation.js"></script>
10+
<script src="https://unpkg.com/[email protected].4/dist/js/nfsfu234FormValidation.js"></script>
1111
<script src="assets/js/script.js"></script>
1212

13-
<script> const ajaxOptions = { url: 'https://unpkg.com/[email protected].3/package.json', RequestMethod: 'GET', }; const NFSFU234FormValidationLibrary = new NFSFU234FormValidation(); (async () => { try {
13+
<script> const ajaxOptions = { url: 'https://unpkg.com/[email protected].4/package.json', RequestMethod: 'GET', }; const NFSFU234FormValidationLibrary = new NFSFU234FormValidation(); (async () => { try {
1414
const response = await NFSFU234FormValidationLibrary.ajax(ajaxOptions);
1515
const title = `${ response.name.toUpperCase() } - v${response.version}`;
1616
document.title = title;

0 commit comments

Comments
 (0)