Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm writing a plugin with an admin screen. I have a set of radio buttons to select the tabs on the plugin's admin page. I also have a 'last_tab' option that allows the administrator to pick up where he left off.

I already have it programmed with PHP that when the admin saves data in a tab, it saves the tab number in the 'last_tab' option.

But sometimes the admin will leave off without saving. I'd like to have the option set to the last tab viewed even when there's been no save. Basically an update of the option whenever a tab is changed (radio button pressed). Listening for the event is easy enough, but how can I use JavaScript to set an option?

share|improve this question
1  
see AJAX in Plugins. –  Milo Apr 3 '13 at 0:48
    
Thanks, Milo. The link is helpful and the first example looks like it will help me do what I need. But the technique is a blackbox recipe. Where can I find an explanation of what's actually going on? –  JohnK Apr 3 '13 at 1:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.