codrops / naturallanguageform Goto Github PK
View Code? Open in Web Editor NEWAn experimental form that uses natural language instead of the usual form layout. Values are entered using custom input elements.
An experimental form that uses natural language instead of the usual form layout. Values are entered using custom input elements.
Great stuff! Just a tiny issue where the css in component.css also affects other forms that are not using the NL Form. Easily fixed by going in and editing the css.
Right now this script just takes the input placeholder by default, even if the input has value="" set to something.
I changed:
this.toggle.innerHTML = this.elOriginal.getAttribute( 'placeholder' );
to:
this.toggle.innerHTML = this.elOriginal.value.trim() !== '' ? this.elOriginal.value : this.elOriginal.getAttribute( 'placeholder' );
Hi, got a problem :)
Tried to implement it, but my design forces me to use divs to encapsulate some of the inputs / options. The problem is that the overlay will not work if another parent exists - mainly because it will not show eg, the css selector ~ works for selectors within same parents, and selecting a parent is only available in CSS4.
So in _open and _close
I have added after
this.fld.className += ' nl-field-open';
this.fld.parentNode.className += ' nl-overlay-open';
so that I can make the css work for the overlay.
Also on _close
this.fld.className = this.fld.className.replace(/\b nl-field-open\b/,'');
this.fld.parentNode.className = this.fld.className.replace(/\b nl-overlay-open\b/,'');
Now it works, but I still have a problem, that when I click the overlay to close it, my other classes on the encapsulated divs are deleted.
Tried to change ALL the className with replace before and += after, still not working.
Any ideas? :)
On upload file i got below error
nlform.js:167
Uncaught InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
How about to convert password inputs values to "******"? What should I do for this enhancement?
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library codrops/NaturalLanguageForm
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "codrops/NaturalLanguageForm",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
I have done some random user testing and 4/10 of them did not hit the arrow icon after typing into an input and just presumed that it was filled in and done.
They don't want to have to click more buttons that necessary.
Is it possible for the input to set when the user clicks away onto another element rather than having to click the arrow?
Hope this makes sense!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.