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"); ?

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

  • 4 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.