Jump to content

Auto Tab to the next field in a form

Recommended Posts

Site URL: https://dogfish-rhubarb-phn9.squarespace.com/contact

I have a client that would like the form on their contact page to 'auto tab' to the next field, particularly when the user is typing in the phone number, he would like it to automatically jump to the next box. If anyone can help with the code for this please let me know!

 

I have tried a bunch of different things that haven't worked, I am trying to apply jquery onKeyUp event but I can't figure out how. The password on the site is FlowersbyB.

Screen Shot 2020-05-31 at 12.55.49 PM.png

Link to comment
  • 8 months later...
  • Replies 6
  • Views 1.6k
  • Created
  • Last Reply
On 2/22/2021 at 11:31 PM, katelyn2 said:

Hey! I'm following up on this and see that you figured out the solution. I have a client who is wanting the same thing. Would you mind sharing how you achieved this? Thank you!

Do you still need this code?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/2/2021 at 9:37 PM, amritanan said:

I'm looking for this code, please! :)

Try adding to Code injection Header

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$( document ).ready(function () {
    $('fieldset.phone > div > label > input').attr('onkeyup', 'moveOnMax(this)')
  	$('fieldset.date > div > label > input').attr('onkeyup', 'moveOnMax(this)')
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/6/2021 at 9:59 AM, tuanphan said:

Try adding to Code injection Header


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$( document ).ready(function () {
    $('fieldset.phone > div > label > input').attr('onkeyup', 'moveOnMax(this)')
  	$('fieldset.date > div > label > input').attr('onkeyup', 'moveOnMax(this)')
});
</script>

Thank you so much!!

 

Link to comment
  • 6 months later...

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.