So if I understand correctly, you are trying to make the page links work in a search results page?
So let's pretend it is Google. You have a search form at the top, so you can search again, and you have some search results, and you have a series of links that represent which page in the search results you want to see. Assuming that is the set up, there are many ways to do this, but the simplest way I can think of is this: You have your initial search form. Add a hidden form field, call it 'viewPage' and initially set the value to '1'. When the user clicks Search, the PHP script gets the message that it is supposed to display page 1 of the results. It generates the results page, like you are used to. In that result page is the search form, again, including the viewPage hidden field. The default value of the search form is the value that was passed in to the script that generated the page. That part is done in PHP, not in Javascript. Same with the viewPage hidden value. Now, the page links invoke JavaScript which modifies the viewPage variable, and then submits the form. Then, when a link is clicked, the user sends the search string back to the server, along with the 'viewPage' parameter. Your server-side script looks at it, sees that you want page 2, for example, and generates the appropriate result. WARNING: If you modify the search term, and then click a page link, it may not do exactly what the user expected. If you don't want it to behave that way, you will need to save the original search term, and submit that. Now, if you are trying to do this all dynamically, and trying to avoid any page reloads, then modify the page number links so that the click event returns false. Then, the page will not reload, and you won't lose the form contents. On Thu, Jan 21, 2010 at 12:29 PM, Danijel <danijel.vuko...@gmail.com> wrote: > I said F5 because i have problem wiht pressing button on loaded form > in div #forms, this form is search form, when i click button "Show > data" in next div #data i display data with pagging, but i do not use > jquery paging, bucause i need different showing items ( description > and picture) and when i click on page "2" page is set to default > values #treview is set to root, #forms is clean, #data dvi is empty. > > on search form > $("#btnsearch").click(function() { > $.post("Advert/pagingAdvert.php", > $("#searchEstate").serialize(), > function(data){ > $("#result1").html(data.description); > }, "json"); > return false; > }); > > > with result "false" i disabled reloading page. but when i click on > page where i used : > <a href="?pg=2" linkindex="95">2</a> > > page is refreshed and all data and froms are set to default values. I > do not have idea hot save state of page. > > can you help maybe with some example, i programming in php in jquery 1 > month and web pages. > > br,Dani > > > On 21 jan., 15:53, John Arrowwood <jarro...@gmail.com> wrote: > > Try creating an unload event handler that goes through your forms and > writes > > the data therein to a cookie. Same thing with the state of the tree. > Then > > write an onload event handler that looks for the cookies, and if found, > > populates the form elements and the tree state. > > > > If that doesn't work, then you are going to have to add events to all of > the > > form elements that allow the cookie data to be saved as you go. > > > > But... why are you pressing F5 in the first place? > > > > > > > > On Thu, Jan 21, 2010 at 1:32 AM, Danijel <danijel.vuko...@gmail.com> > wrote: > > > i spent about several days trying to figure out hot to save state of > > > open forms. > > > > > In my web page I have a jquery treeview tool, when I click form is > > > loaded into the #treview div. > > > > > $(document).ready(function(){ > > > .... > > > > > $("#treview").treeview({ > > > url: "category_async.php", > > > fileClick: function() { > > > id = $(this).attr("id"); > > > $.get("categories.php?id=" + id, {}, function > > > (data) { > > > $("#forms").html(data); > > > }); > > > } > > > }); > > > ... > > > > > }; > > > > > data repreesnt url page address i.e. "forms/inputdata.php" > > > > > When i F5 - refresh page on browser div #forms clears and div #treevew > > > is set > > > to root element. > > > > > I exepcteed #treeview should stay open (on the node which i clicked) > > > and #form should have page loaded with inserted data ../forms/ > > > inputdata.php > > > > > What should i do to treevew will stay open, page will stay in div > > > #forms and > > > data will be displayed on page? > > > > > thanks in advance > > > > > br,Dani > > > > -- > > John Arrowwood > > John (at) Irie (dash) Inc (dot) com > > John (at) Arrowwood Photography (dot) com > > John (at) Hanlons Razor (dot) com > > --http://www.irie-inc.com/http://arrowwood.blogspot.com/ > -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/