Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compose-form-up

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compose-form-up - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

12

lib/validation.js

@@ -35,2 +35,7 @@ // Dependencies

// Ensure all required inputs have aria-requrired attributes
toolbox.slice( document.querySelectorAll( '[required]' ) ).forEach( function( element ) {
element.setAttribute( 'aria-required', true )
})
// Watch input events

@@ -97,2 +102,3 @@ Event.on( document, 'blur', '[required]', checkValidation )

el.classList.remove( 'invalid', 'valid' )
input.setAttribute( 'aria-invalid', false )

@@ -103,2 +109,3 @@ } else {

el.classList.toggle( 'valid', valid )
input.setAttribute( 'aria-invalid', valid )

@@ -232,3 +239,3 @@ }

if (msg ) msg.parentNode.removeChild( msg )
if ( msg ) msg.parentNode.removeChild( msg )

@@ -247,3 +254,4 @@ }

if ( label ) {
label.insertAdjacentHTML( 'beforeend', '<aside class="validation-message"><p>' + message + '</p></aside>' )
label.insertAdjacentHTML( 'beforeend', '<span class="validation-message hidden"><span class="validation-message-text" role="alert">' + message + '</span></span>' )
label.lastChild.classList.remove('hidden') // Allow for transition
}

@@ -250,0 +258,0 @@

5

package.json
{
"name": "compose-form-up",
"version": "1.6.0",
"version": "1.7.0",
"description": "A lightweight HTML5 form validation utility",

@@ -24,9 +24,6 @@ "main": "index.js",

},
"homepage": "https://github.com/compose-ui/form-up#readme",
"dependencies": {
"compose-toolbox": "^1.0.0"
},
"devDependencies": {

@@ -33,0 +30,0 @@ "chai": "^3.5.0",

@@ -65,3 +65,15 @@ # FormUp

Using `invalidateField` you can easily invalidate a field's current value.
```js
formUp.invalidateField( element, [message] )
```
For example if you find a usename is already taken, you could invalidate the username field like this.
```js
var username = document.querySelector( 'input[name=username]' )
formUp.invalidateField( username, "Username: " + username.value + " is taken. ")
```
## Progressive Forms

@@ -68,0 +80,0 @@

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