Hi does any of you no the hack so you can have ajax inside ajax so like showing the page in ajax and in that page there is a form that submits using ajax. If you need to see the ajax code's ill post it here if you ask. Thanks in advanced.
Alright I have done this and works perfect! Let me first tell you how this works - index.php -><- con1.php (Through ajax variable "name" sent to con1.php and and is shown at div tag "results") Then con1.php has another form within it now this too has a field. index.php-><-con1.php-><-con2.php (Through ajax variable "name2" sent to con2.php and and is shown at div tag "results2") Here is the demo The current one leaves the content retrieved from con1.php, but if you want it can be even done as con2.php's content replaces the first ajax received content. The codes are a bit long to write here, therefore I've zipped them here http://hakc.net/ajax-in-ajax/ajax-in-ajax.zip Code (markup): I can get a tutorial too written on how this works, if you want at my blog. 3l3ctr1c
Thanks for you help jst downlaoded the zip file gona take a look at the code in a min ill tell you if i get it to work with my ajax.
Hi this is the code im useing for my form see code here and the js file for the form is here. and for that ajax window im showing the content with the code is here to view. that jst useing a div like your code does I found you code very usefull for other things but im abit stuck with my form bit that i have if you have time to look and see if ther is an easyer way to do it. Thanks in advanced.
I'll do that and edit this entry if possible by tommorow. edit : It'll be good if you make it simple like a normal non ajaxed php script that makes it easier to ajax, so if you can do that in a simple php script with say get/post It'll be easier.
ok sure thanks do u want it wil just a thew imputs on and ill edit the script later for more form imputs or do you want the full form.
Is this ok Iv spaced all the forms imputs away from the table so its easy to read if you want me to just put the form code there with no table bits just say and i will delete all th table code. <form name="settings" method="POST" action=""> <fieldset> <legend><strong>Add Site</strong></legend> <table width="75%" border="0"> <tr> <td width="25%">Active:</td> <td width="75%"> <select name="active" id="active"><option>True</option><option>False</option></select> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Bid:</td> <td width="75%"> <input name="bid" id="bid" type="text" value="<?php echo $_POST["bid"]; ?>" size="12"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Name:</td> <td width="75%"> <input name="name" id="name" type="text" value="<?php echo $_POST["name"]; ?>"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Date:</td> <td width="75%"> <input name="date" id="date" type="text" value="<?php echo date("d-M-Y"); ?>"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Updated Date:</td> <td width="75%"> <input name="udate" id="udate" type="text" value="<?php echo date("d-M-Y"); ?>"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Title:</td> <td width="75%"> <input name="title" id="title" type="text" value="<?php echo $_POST["title"]; ?>"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Description1:</td> <td width="75%"> <input name="desc1" id="desc1" type="text" value="<?php echo $_POST["desc1"]; ?>"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Description2:</td> <td width="75%"> <input name="desc2" id="desc2" type="text" value="<?php echo $_POST["desc2"]; ?>"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Description3:</td> <td width="75%"> <input name="desc3" id="desc3" type="text" value="<?php echo $_POST["desc3"]; ?>"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Link:</td> <td width="75%"> <input name="link" id="link" type="text" value="http://"> </td> </tr> </table> <table width="75%" border="0"> <tr> <td width="25%">Email:</td> <td width="75%"> <input name="email" id="email" type="text" value="<?php echo $_POST["email"]; ?>"> </td> </tr> </table> </fieldset> <br /> <input name="submit" type="submit" value="Submit" /> <input name="reset" type="reset" id="reset" value="Reset"> </form> HTML:
alright I'm doing it, will edit this as soon as I finish. How exactly you want it, I don't get like the above code when submited -> add-save.php then what ? say the above code is index.php and it has go into add-save.php so the code now is like index.php-><-add-save.php Now what do you want the thing to do once the data is feed into add-save.php ?
Thanks your a (star) rep added only if my paypal info was updated i would of give you some money thanks for all your help. ANd one more thing is it possable to define a page thats in ajax and get to check if its on a page it can be viewed on e.g. On the ajax page you have this at the start of the page: if (!defined('valid')) { die("This page cannot be accessed directly."); } PHP: and on the page that it can be viewed on it has : define('valid', 1); PHP: Or is ther anuther way to do this to work with ajax.