Welcome Guest, Not a member yet? Register   Sign In
Save and return to same place on page
#1

[eluser]bazianm[/eluser]
I have a web system that I inherited from another developer. He used CodeIgniter.

We have a form that is basically a huge series of tables. Think of it like a long excel sheet. The users are entering their data (the data is organized into categories) and after each category there is a button where they can click save and save their work.

The problem is that the save button, which does a submit on the form, reloads the form and brings them right back to the top.

Is there a way I can return the user to the place they were at on the page?

Thanks in advance for any assistance...
#2

[eluser]davide_graziani[/eluser]
Ciao,
every time you submit a form...your reload the page.
Have you think to submit the form with asynchronous method (ajax), so you don't need to reload the page.
#3

[eluser]PhilTem[/eluser]
Either you use AJAX for submitting just the form but not reloading the page, OR
you add anchors to your page and add these anchors as a hidden input field to the form. On submit you just check for that input-field and reload the page to the appropriate anchor-tag. That's the easier version because AJAX can be a real pain on setting it up.
#4

[eluser]pickupman[/eluser]
Using jQuery makes AJAX pretty simple now a days. What took 20-30 lines of code before, can now be done in 1. This also is a much better time saver than frequent page reloads, and then scroll. Also, nice plugins like jEditable can speed up data entry, as it can take a page element and let you edit in place. Losing focus of the form field automatically submits it via jQuery/AJAX.
#5

[eluser]bazianm[/eluser]
Wow. Thanks. I have never used Ajax before. Can you recommend a good resource to learn about it?
#6

[eluser]pickupman[/eluser]
The [url="http://api.jquery.com/jQuery.ajax/"]jQuery AJAX[/url] api is a good place to start. There are some simple examples there. Also using the [url="http://api.jquery.com/jQuery.post/"]$.post()[/url] function which derivative to $.ajax(), without all the granular options.




Theme © iAndrew 2016 - Forum software by © MyBB