0

I am using google chrome71, and here in input tag, Autocomplete/autosuggestion where the browser does automatically fill the input field is not working in react +HTML.

I have added form tag outside but didn't found any luck to get the autocomplete suggestion.

<form>
<label style={{ display:'none' }} htmlFor='mobile'>Name</label>
  <input className=''
     type='text' placeholder='Mobile number' autoComplete='tel'
     value={props.mobilenumber} name='mobile' id='mobile'
     onChange= {props.actionHandler} />
</form>

Here I expect to autocomplete of number, which I used earlier... Appreciate.

Anupam Maurya
  • 1,927
  • 22
  • 26

2 Answers2

0

From the possible duplicate link provided in comment:

For phone:

  • Use any of these for name: phone mobile country-code area-code exchange suffix ext
  • Use any of these for autocomplete: tel
Arnaud Christ
  • 3,440
  • 3
  • 24
  • 33
0

Here is working JSX code,

<iframe style={{ display:'none' }} name='form_name' src='login:blank' />
<form onSubmit={actionName} className='col-sm-12 pad0' target='form_name' action='login:blank'>
    <input className=''
        type='text' placeholder='Mobile number' autoComplete='tel'
        value={props.mobilenumber} name='mobile' id='mobile'
        onChange= {props.actionHandler} />
    <input type='submit' style={{ display:'none' }} id='inputSubmit' />
</form>

 <div className=''>
    <button buttonText='Submit'
        onClick={
        () => {
            document.getElementById('inputSubmit').click()
        }
        } />
</div>
Anupam Maurya
  • 1,927
  • 22
  • 26