JavaScript code call method in controller?

I have this text field that once a certain number of character are
entered I would like it to call a method in the controller and save the
data. To make a long story short, I do this because I don't want the
user to hit a button to submit, but want this to be a quick edit option
for entering a telephone number.

What I am doing is to check the number of character in my javascript, if
the length equals the max I would like my method call to happen. Is
there a way to call a controller method from a javascript method?
Thanks,

-S

...which is probably better, or at least more universal, since a "phone
number" can be an arbitrary number of digits. :slight_smile: