ForgeComponents
en

Components

j-Enter

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

This component evaluates some method if the user press enter. Important: component finds all input elements and performs CAN() for the path.


Configuration:

  • exec {String} a method name for execution
  • validate {Boolean} enables validate (default: true)
  • trigger {String} can contain a selector for triggering a real click event (default: button[name="submit"])
  • timeout {Number} a timeout as a prevention for multi-press of enter key (default: 1500)
  • NEW delay {Number} a delay for submitting data (default: 500 ms)

Use it with <ui-component name="enter">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<ui-component name="enter" config="exec:doSubmit;validate:false"  style="padding:50px;max-width:300px">
	<div>Login</div>
	<div><input type="text" /></div>
	<br />
	<div>Password</div>
	<div><input type="password" /></div>
</ui-component>

<script>
	function doSubmit() {
		alert('ENTER pressed');
	}
</script>