Jump to content

Dynamic Ajax Content with Form Submit and Header redirect


dragon_sa

Recommended Posts

I am using the following with some code that I am happy with the function of, but have struck an issue with forms, hoping someone could help me to tweak this to work.

 

1) Script Title:

Dynamic Ajax Content

 

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

 

3) Describe problem:

Is it possible to use this script when submitting forms, I would like to load the form processing page into the div and then use a php header redirect when processed to load another page into the same div, is this possible with this script, or is there a better script for doing this?

a: If it is possible what is the method and syntax for the form action on submit?

b: What would be the syntax for header("Location: ajax url"); ?

Yes it is possible to alter this script to do what you want. The heart of the matter is this line ajaxpage('ajaxfiles/external.htm', 'rightcolumn').

 

It calls the function ajaxpage(). It tells it what file to load = 'ajaxfiles/external.htm'. And where to load it. = 'rightcolumn'.

 

Make the 'rightcolumn' the main container of your body element - make it permanent and you don't have to pass that.

 

Add all the fields you want to store from the file = Here you must pass the same number for every form [some would be empty].

 

And you could also choose what the next form should be.

---------------------------------

 

Server side you use the form name in a switch to process all forms and store into database. Then use the nextformname to echo the html form back back down to the page.

 

 

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.