• Status: Solved
  • Priority: Medium
  • Security: Private
  • Views: 27
  • Last Modified:

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.
0
zachvaldez
Asked:
zachvaldez
  • 5
  • 3
  • 2
1 Solution
 
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 MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy 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 MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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 MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now