php – Change the order of tabindex on focus at a form


I have a form the same as on the attached image.

On the form WordPress PHP file the order of the fields is as follows: two first fields, then custom fields shortcode, and then the email field.

I did a reordering of the fields using SCSS so to keep the two custom fields before the email but to move the last custom field- Organization to the end of the form.

Now the tab index moves the cursor to focus on the fields on the way – field 1, field 2, field 3, field 4, field 6, and field 5. So the last field is the email field. As for how I said above on the PHP template the custom field shortcode is added before the email field and all the time Organization field has a tab index lower than the email field.

I would like to know is there a way to not move the email field position before the custom fields, but with JavaScript/jQuery to change the tab index order and the email fields to be on focus before the Organization field. So the order to be field 1, field 2, field 3, field 4, field 5, and field 6.

What I tried – I add a tab index in any possible way I know with static index attribute but it adds the lower tab index to the Organization field than on the email field. The Organization field is part of the custom fields with the other two custom fields Country and Zipcode. The custom fields shortcode is displayed on the PHP template before the email field but I moved the Organization field position with SCSS after the email field. i


Ilianskia 2 years 2022-05-14T12:24:55-05:00 0 Answers 0 views 0

Leave an answer