sadaf2605 sadaf2605 - 1 month ago 13
Javascript Question

Update HTML form with Javascript while typing

I can update an HTML form using Javascript, when the user hits enter when on something on the form or when he triggers the

onclick
event on the "submit" button, but I want the form to be updated while the user is typing something.

I know that I can do
Infinity loop
, yet it is not a good idea; or I can check after intervals but it will cause unnecessary checking, which I don't want.

Answer

Use keyUp event handler with the input field contained within your form.

References: Javascript, jQuery

[UPDATE]

You missed round brackets at function definition, check the updated fiddle