const React = require('react') module.exports = (props) => { return ( <div> <input id={props.id} type="text" title={props.placeholder} onBlur={e => props.onBlur(props.fieldName, e.target.value)} style={props.style} tabIndex={props.tabIndex} onKeyPress={(e) => fourthMethod(e, props.id,props.pattern)} /> </div> ) } function fourthMethod(e,id,pattern) { if (id == "#01013") { console.log(id); const re = new RegExp(pattern); // const re = /[a-fA-F]+/g; if (!re.test(e.key)) { e.preventDefault(); } } }
const TextInputComponent = require('../../components/TextInput') const TextInput = ({ fieldName, placeholder, style, id, tabIndex, pattern }) => { return ( <TextInputComponent pattern={pattern} id={id} tabIndex={tabIndex} onBlur={fieldChanged} fieldName={fieldName} placeholder={placeholder} style={style} ></TextInputComponent> ) }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)