Page 1 of 1

Project wizard via Ajax

Posted: Thu Nov 26, 2009 7:32 am
by greg7
Hi guys, I design an application in which i get variables as inputs or outputs (set by the client) and then I process them. I need to use a project wizard as interface for the clients in order to enable them to name the project variables and choose the type (if they are inputs or outputs). Then with Next button i need to save the data in variables like a string

Code: Select all

$inputs.= ...  and  $outputs.= ...
in order to write at the end to database (when client click finish button).The number of project variables is unknown so i have to reload the form untill client terminates it(with finish button). I think i have to use AJAX, by this way i won't have to reload the form, and the data will be posted with click on button Next. I know how to send the data to "process.php" but i dont know how to save and preserve the posting data in variables . It can't be done to pass the response variable from js to php, so i think (1) to use a hidden field to the form and save the response in it, but then i don't know how to retrieve the varname and the vartype (Input/Output). The other way (2) to implement it, is to save in "process.php" the varname and the vartype into sessions, but then how can i retrieve them and generate the CREATE TABLE statement?

Code: Select all

 
<form id="wizard"  action="" method="">
<input id="varname"  name="varname" type="text" size="20" />
<!-- <input type="hidden"  name="varname"> -->
<input type="radio" name="vartype" value="input">
<input type="radio" name="vartype" value="output">
<input type="reset" value="Cancel" >
<input type="submit" value="Back" >
<input type="submit" value="Next" >
<input type="submit" value="Finish">
 

(3)Finally i thought to write in a txt file and on finnish read it and generate the create statement.
I don't know exactly how do it and maybe i'm too far from the solution, any suggestions or similar scripts would be grateful, thanks in advance!