Log in

View Full Version : script to load just the form parts of the page.



izzysanime
09-25-2007, 03:37 PM
Hi,

i was wondering if there is a script that can re-load just the form parts of my web page. There are other parts of the page, like images, and other navigational items that would not need to re-load.

What happens is my webpage has a form that when its filled out and submitted, it bring the user back to the same form to re-fill out again. So, I was wondering if there was a way to have the form re-load and the other parts not reload.

Either that or the page never reloads, when the user hits the submit button, sends the data without actually leaving the page, then the form is blank again. Maybe a thank you text appears at the bottom. Does that make any sense?

Thanks,
Josh

boogyman
09-25-2007, 03:56 PM
the obvious question here is why the double submit?
if you jsut want to send to 2 different places you can create a function to submit the form to 2 places..
forcing someone to enter their data in 2 times is confusing and would be very frustrating for the user

izzysanime
09-25-2007, 04:15 PM
o, its not like that. Its a form for a Database system. When the user fills out the form, they get the file they want, then they need to re-fill it out for the next file they want. Does that make sense?

Thanks,
Josh

boogyman
09-25-2007, 05:23 PM
you can create a session variable, so the user would only need to input his / her information once per browser session (from the time a browser is opened to the time the browser is closed). upon submission you write the values to the session, and you attempt to get the values from the session upon returning to the form.

the other option is one that would allow you to transfer between session. you can write a cookie to the person's machine. if you checked "remember me" here on this site, that would be an example as you can open a new session and you would be logged in automatically.... you need to be careful with this though, because they can be abused by malicious users, so the only thing you should store in a cookie is a reference of a reference. what I mean by that is a unique identifier variable or number that is then processed on your server to grab the needed information, which is stored in the database.


now one thing to note on this is that if the only thing you are changing is the "file input" you really do not / should not do any of this, but rather you should create a button that would dynamically create a new "file input" and after everything has been submitted, the processing would just loop through all of the set file inputs and print out an error / success for the files

izzysanime
09-26-2007, 01:51 AM
OK, im not sure if my request makes sense then. On some sites, there are drop down menus that when each option of them is selected it loads the options info. But it just loads the info, and not the rest of the page. So, i was wondering if there was something similar that would allow me to send the form info to the regular form script, but at the same time reload the form part of the page and not the rest. (I would put the form part in its own div tag). Does that make more sense?

thanks,
Josh

tech_support
09-27-2007, 09:17 AM
Looking for this (http://www.twey.co.uk/?q=forms)? ;)

izzysanime
09-28-2007, 01:11 AM
Hi,

thats really close, but the user wont be clicking on anything. The form is not really something the user fills out. It is used to display info from a CGI script and the forms on the page is updated every second, the problem is the browser refreshes, so I was looking for something that can load the info from the cgi script but not blank the page.

Sorry, i know its not what i described now, it changed slightly. I guess i just dont want the browser to have to refresh.

Thanks,
Josh