[AJAX] Dynamic content and a form

SpaceshipSpaceship
Watch

greenowl

Established Member
Impact
3
Okay, I have been looking everywhere for a merging of sending form data through dynamic content code. By dynamic content I mean like: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
Now that is fine and everything, but what if I have a form and want to send it though the dynamic page thing it wont work. Because I noticed this uses a GET function to get the page. I have tried changing the function to POST

Code:
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('[B]POST[/B]', url+bustcacheparameter, true)
page_request.send(null)
}

But it still wont work. Okay I will admit I am a complete noob when it comes to ajax etc, I really only know a bit of css and a bit of html and a bit of php. So what I am trying to do is send some data through this script making it not have to refresh the page and load the php page with the post data sent.

Here is my form
Code:
<div id="contentarea">
<form action="" method="post" name="text" id="main">
<input name="test" type="text" />
<input name="Submit" type="Submit" value="Submit" onclick="javascript: ajaxpage('form.php', 'contentarea');"  />
</form>
</div>

and the php page is a simple echo for now that will echo the data sent through the form. (Of course once I learn how to send the form through the ajax script it will change.)

Note: The reason I am not using some other form script is because I wish to still use this ajax script to fetch php page as well (without the post function).

Thanks to anyone that can help me with this problem. ;)
Will check back later.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
NameMaxi - Your Domain Has Buyers
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back