0
votes

Trying to get a cursor to appear in one field in my Gravity Form. This is my Javascript, but it's not working:

<script type="text/javascript">
jQuery(document).ready(function($) { jQuery('#input_22_1').focus(); });
</script>

I've double checked the input several times to make sure I had the correct one yet this isn't working. The page I'm trying to get it working on is here: http://tinyurl.com/h8muwvp and the field is the Name of Business field.

1

1 Answers

0
votes

You have a syntax error in your Javascript. From the console:

Uncaught SyntaxError: Unexpected token <

custom_js.js:7

A more elegant solution would be to use the HTML autofocus attribute on the form field.