Form field focus on tabs
Form field focus on tabs
I am currently working on a javascript form preview function. I plan to convert this to jQuery instead because of its many advantages.
I have a straight-forward form, I click preview and the form gets hidden and a table is generated within a div showing all form fields and their values, as well as javascript-generated cancel and form submit buttons. This all works on the same html page.
I would like to add an "Edit" link next to each preview element so that the user can click the link; the preview will then disappear, the form will appear again (simple js + css) and focus will be applied to the particular form field. For a straight-forward form this would be fine.
My problem lies in the fact that my form will use javascript tabs (soon to be jQuery tabs) and I'm not sure how I can click the Edit link and apply focus to the form field but also this process should take into account which tab the form field actually lives on and this should be displayed also.
So to summarise just in case its needed:
I need to click a link that hides a div (preview), displays the form again, selects the tab that the particular form field lives on and then applies focus to the form field.
If anyone can help that would be awesome.
Ta
Col