Multi Page Form

zeeshanaqeel 27 Nov, 2010
Hi,

I have a multi page form of about 6 pages, on the first page, I generate a user id using following code on the first page:
$consultant_gen_code = date("ym") . "" . date("d") + date("s") + date("i") + date("G");
echo "<input type='text' style='display:none;' name='consultant_id' id='consultant_id' value='".$consultant_gen_code."'>";

Unfortunately this code does not passes the consultant id to the proceeding pages,

I have even tried using the following code onSubmit code, which does pass it on to the next page only but not till the end, where it stores the form in the database and sends out an email:

$consultant_gen_code = date("ym") . "" . date("d") + date("s") + date("i") + date("G");
JRequest::setVar('consultant_id', $consultant_gen_code, 'post');

Please advise where I am going wrong, I am going crazy with this issue.

An early response will be highly appreciated.

Thanks,

Zeeshan
GreyHead 27 Nov, 2010
Hi Zeeshan,

Try
echo "<input type='hidden' name='consultant_id' id='consultant_id' value='".$consultant_gen_code."' />";

Bob
zeeshanaqeel 27 Nov, 2010
This doesn't work either, in fact I have tried using hidden type before having a text field and appliying a style display none.. I am going crazy over this!!!!! please help me.

I use following code to display the id on every page:

$consultant_id = JRequest::getString('consultant_id', '', 'post');
echo "Your Consultant ID is:" . $consultant_id;


But of no use. Plus it doesnt dump the ID in the table too, when it dumps all other fields. This is sooo strange.
GreyHead 27 Nov, 2010
Hi Zeeshan,

Then the problem isn't with the code you are posting here but somewhere else.

Please post a link to the form so we can take a quick look.

Bob
This topic is locked and no more replies can be posted.