Stay on a current tab after after submitting a form using jQuery

后端 未结 8 660
一生所求
一生所求 2021-01-18 08:14

I\'m trying to stay on a specif tab ( in this case tab2 ) but after clicking the submit button the tab reverts to tab 1 which has the default class of active. I have hit a b

8条回答
  •  [愿得一人]
    2021-01-18 08:48

    You could store the "id" of the selected tab inside a variable when the user clicks the send button and restore it after the form is posted to the server. Take a look at the Form events for more information

    http://api.jquery.com/category/events/form-events/

提交回复
热议问题