2
Very good day!
I have a form with only one input:
<input type="number" name="codigo" class="form-control" style="margin-left: 2%" autofocus id='codigo'>
And I need that when the input reaches 6 characters it automatically finalizes the form and sends the information to the page on action=''
, or "emule" the enter button event, or activate the <button type="submit">
is it possible to do such a thing? It is necessary that there be no need for human action to press the button.
Thank you in advance!
Wouldn’t it be better to use
$('form').submit()
instead of simulating the click on the button?– fernandosavio
I clicked the button per request on the question, but it’s a good idea. I’ll add in the reply this other solution. Thank you!!
– Pedro Paulo
I asked why the author of the question does not always know exactly what he needs :)
– fernandosavio
Truth........
– Pedro Paulo
Thank you very much, helped me a lot and solved my problem!
– Vengi