groupinputs | Easy data input into several inputs | Editor library
kandi X-RAY | groupinputs Summary
kandi X-RAY | groupinputs Summary
Easy data input into several inputs. Inputs begin to behave as if they share data: - When one input is filled out the cursor moves to the next - Left/right arrows move cursor to the previous/next input - Pasting the text will fill out several inputs and cursor will be left in the end of the pasted text as if it was a single input field.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of groupinputs
groupinputs Key Features
groupinputs Examples and Code Snippets
Community Discussions
Trending Discussions on groupinputs
QUESTION
I'm trying to iterate over a nested JSON object using .map()
and output different HTML Templates depending on the JSON inputType: "value"
. I want to use the correct template (es6 template literal) based on a Ternary Operator and stamp the correct HTML to the DOM.
I've gotten pretty far, but I'm running into an issue with Level 6 (form template) and Level 7 (input templates). Can anyone point me in the right direction?
Codepen: https://codepen.io/oneezy/pen/GxENOr
JS (the full javascript was omitted..please see codepen)
...ANSWER
Answered 2018-Mar-28 at 02:55form.inputType['text'] ? textfieldTEMPLATE(form.inputType) : ''
the issue here is that form.inputType
has a string value .. text
| select
etc ... but that code checks if form.inputType
has a property called text
... it doesn't ...
so, perhaps you want form.inputType == 'text' ? textfieldTEMPLATE(form.inputType) : ''
However, that's only one problem solved... the other is what you do inside textfieldTEMPLATE
etc ... performing .map
on the passed in string ... strings don't have a map method
So, you want to change as follows: note, the *TEMPLATE
functions are called with the parameter form
, not form.inputType
- because form
is an object
with useful properties to create the elements, whereas form.inputType
is a string, and not helpful for what you want to do
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install groupinputs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page