Autosubmit javascript

Javascript:

JQuery: