Triggering a save when clicking a tab

I have several tabs in the page. What I'd like to do to is to trigger or execute a save on the page. On each tab, I have a save button. For each navigation attempt or move to a different tab, I'd like to save it.
zachvaldezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
What control are you use for tabs?
0
zachvaldezAuthor Commented:
Bootstrap but did not add a runat=server.
Right now, I have a jQuery call function
attached to button click. If I make this server side process,I might lose this functionality.
0
Big MontyWeb Ninja at largeCommented:
in your tabs definition call, you want to use the SELECT" event to fire off your save routine, something like this:

$('.tabClassName').tabs({
  select: function(event, ui){
    //-- fire off save method that you're for your save button
  }
});

Open in new window


assign a class name to each of your tabs (it doesn't have to be defined in css if you want to create a brand new one for this) and change "tabClassName" to whatever you choose as a class name.

This also assumes your SAVE button is firing off it's save functionality as an ajax call to the server. if it's not, then you'll need to change the save function (or add a separate save function) to use AJAX
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

zachvaldezAuthor Commented:
My save button is code behind 100% but my tabs uses jQuery as of now.
just to clarify, should I can my save button code?
0
Big MontyWeb Ninja at largeCommented:
if you're going to use ajax, then you could probably use some of that code
0
zachvaldezAuthor Commented:
I don't know how put the pieces together with Ajax. Will you post the solution and I'll study the Ajax code.Thanks
0
Big MontyWeb Ninja at largeCommented:
have a look at the link I posted, it has several examples on how to use ajax. if you have specific questions, ask, but I can't write it for you with only the code you've given so far
0
CodeCruiserCommented:
Are you using webforms or MVC? Can you show us a trimmed down version of your markup and script?
0
zachvaldezAuthor Commented:
I decided not to pursue this method as its too complicated to validate. Thanks for pitching ideas. Until I get a clearer picture of it,I'll pursue later.
0
zachvaldezAuthor Commented:
I pick this solution because it may really need Ajax. Need to download the toolkit.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.