blackcell Posted June 4, 2008 Share Posted June 4, 2008 I need a user to be able to click on a row on page1.php that goes to page2.php. When the user clicks back on page2.php I need them to jump back to page1.php at the same location they left from. I know this has to do with <a name='#name'></a> but I think it will require javascript to be able to span this across two pages. Matter of fact I can get it to pass the value but I don't know how to incorporate the <a name='#name'></a> to load on the return without clicking on something. Edit was: without clicking on something. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 4, 2008 Share Posted June 4, 2008 Well, on page 2, you can use something like this: <a href="javascript:history.go(-1)">GO BACK</a> then, it will be like clicking the back button, which should jump to the part of the page they were at other then that, the only thing i can thing of giving each row a <a name="#row1"> tag (increment the number after after 1) and then supplying that in the URL when they "go back". Does that makes sense? Quote Link to comment Share on other sites More sharing options...
blackcell Posted June 5, 2008 Author Share Posted June 5, 2008 What I am doing now is rolling out 4000+ records into display. On each row is a record and I assign <a name='$recid'></a> in first cell where $recid is the unique database record ID. When they click the row it will pass the record ID to view additional information pertaining to that record (page2.php). What I want is for the user to be able to look at the record and then hit the back button and returning them to the point they left off so they don't have to start at the top of 4000+ records. Will this work that way? <a href="javascript:history.go(-1)">GO BACK</a> Edit: Also, they user will be editing on page2.php therefore hitting the submit button multiple times. Will this throw the js piece off? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 5, 2008 Share Posted June 5, 2008 If they are doing things on that page, the javascript back won't work. But what you can do is provide a button or link to return to the list: <a href="page1.php#<?php echo $recid; ?>">Return to list</a> where $recid would be the current unique ID they are working with. After working out this non-javascript method, you may want to look into some AJAX. So when a user clicks the record, it brings up a Lightbox or Modal Dialog with the records info. Then, allow them to edit and submit changes all with AJAX. Here is one example: http://extjs.com/deploy/dev/examples/form/form-grid.html Quote Link to comment Share on other sites More sharing options...
blackcell Posted June 5, 2008 Author Share Posted June 5, 2008 I like that idea, but space constraints are going to be an issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.