New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aspnet-client-validation

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aspnet-client-validation - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

2

package.json
{
"name": "aspnet-client-validation",
"version": "0.4.0",
"version": "0.5.0",
"description": "Enables ASP.NET MVC client-side validation, without jQuery!",

@@ -5,0 +5,0 @@ "main": "dist/aspnet-validation.js",

@@ -49,3 +49,3 @@ # ASP.NET Client Validation

require('core-js');
const aspnetValidation = require('aspnet-validation');
const aspnetValidation = require('aspnet-client-validation');

@@ -60,3 +60,3 @@ let v = new aspnetValidation.ValidationService();

import 'ts-polyfill';
import { ValidationService } from 'aspnet-validation';
import { ValidationService } from 'aspnet-client-validation';

@@ -131,3 +131,3 @@ let v = new ValidationService();

```ts
import { ValidationService } from 'aspnet-validation';
import { ValidationService } from 'aspnet-client-validation';
let v = new ValidationService();

@@ -176,3 +176,3 @@

```ts
cost form = document.getElementById('form');
const form = document.getElementById('form');
form.addEventListener('validation', function (e) {

@@ -182,1 +182,45 @@ /* Check if form is valid here. */

```
## Programatically validate a form
```ts
v.validateForm(document.getElementById('form'));
```
## Checking form validity
```ts
v.isValid(document.getElementById('form'))
```
By default it will try to validate the form, before returning whether the form is valid. This can be disabled by setting the `prevalidate` parameter like so:
```ts
v.isValid(document.getElementById('form'), false)
```
You can also supply a callback function to be run after the check.
```ts
v.isValid(document.getElementById('form'), true, myCallbackFn)
```
## Checking field validity
Similar to checking a forms validity, you can check individual fields too.
```ts
v.isFieldValid(document.getElementById('field'))
```
By default it will try to validate the form surrounding the field, before returning whether the field is valid. This can be disabled by setting the `prevalidate` parameter like so:
```ts
v.isFieldValid(document.getElementById('field'), false)
```
You can also supply a callback function to be run after the check.
```ts
v.isFieldValid(document.getElementById('field'), true, myCallbackFn)
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc