web wizard question

D

david

Hi All,

I wrote a web wizard with cgi which contains of a couple of 4 steps.
In each step the user can go forward and backward. My problem was that
the script has to remember what the user chose in each step. I thought
about an option to send the selections from the other steps with
hidden fields. This is a little tedious, so I decided to write the
wizard with javascript. This solution has two problems. 1) All the
steps have to be loaded from the beginning. 2) Accessibility issues.

Is there a convenient solution for this in perl ?

Thanks in advance,
David
 
P

Peter Makholm

david said:
In each step the user can go forward and backward. My problem was that
the script has to remember what the user chose in each step. I thought
about an option to send the selections from the other steps with
hidden fields.
[...]

Is there a convenient solution for this in perl ?

Look at CGI::Session (http://search.cpan.org/perldoc?CGI::Session)
there is even a tutorial.

//Makholm
 
X

xhoster

david said:
Hi All,

I wrote a web wizard with cgi which contains of a couple of 4 steps.
In each step the user can go forward and backward. My problem was that
the script has to remember what the user chose in each step. I thought
about an option to send the selections from the other steps with
hidden fields. This is a little tedious,

I don't find it very tedious. Maybe I have low standards, or maybe you are
doing it wrong. Can you show us some relevant code?

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
D

david

I don't find it very tedious.  Maybe I have low standards, or maybe youare
doing it wrong.  Can you show us some relevant code?

Xho

--
--------------------http://NewsReader.Com/--------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Now is my code not interesting because i make all the work in
javascript and get a cgi, as i would not have a wizard. All the
parameters are sent once. My problem was that i have to remember what
i chose in each step. lets say if i have a wizard with 4 steps. I
have in step 2 of the wizard a multiple select and i select there 5
items. Then i go to step 3 and then back to step 2. the program has to
remember the selection of step 2. I can make this with hidden fields
where each control of every step is a hidden field. But in every step
of the wizard i have to give in the html for every control of the
other steps a hidden field
This makes it tedious
 
B

Bill H

Now is my code not interesting because i make all the work in
javascript and get a cgi, as i would not have a wizard. All the
parameters are sent once. My problem was that i have to remember what
i  chose in each step. lets say if i have a wizard with 4 steps.  I
have in step 2 of the wizard  a multiple select  and i select there 5
items. Then i go to step 3 and then back to step 2. the program has to
remember the selection of step 2. I can make this with hidden fields
where each control of every step is a hidden field. But in every step
of the wizard i have to give in the html for every control of the
other steps a hidden field
This makes it tedious- Hide quoted text -

- Show quoted text -

Not perl but, use a hidden ilayer or div for each step. Enclose all
the layers in the same form element, only show the layer they are on.
That way all the form elements retain their values from one step to
the other and you only have a single post back to the server when they
are done.

Bill H
 
X

xhoster

david said:
Now is my code not interesting because i make all the work in
javascript and get a cgi, as i would not have a wizard. All the
parameters are sent once. My problem was that i have to remember what
i chose in each step. lets say if i have a wizard with 4 steps. I
have in step 2 of the wizard a multiple select and i select there 5
items. Then i go to step 3 and then back to step 2. the program has to
remember the selection of step 2. I can make this with hidden fields
where each control of every step is a hidden field. But in every step
of the wizard i have to give in the html for every control of the
other steps a hidden field
This makes it tedious

use CGI;
my $cgi=CGI->new;
#.....
print $cgi->hidden('param_name');

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
D

david

use CGI;
my $cgi=CGI->new;
#.....
print $cgi->hidden('param_name');

Xho

--
--------------------http://NewsReader.Com/--------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Thanks, I think this will do the trick. Something like this.
foreach my $param_name ($cgi->param) {
print $cgi->hidden($param_name,$cgi->param($param_name));
}
 
X

xhoster

(please don't quote sigs. Sig snipped)
Thanks, I think this will do the trick. Something like this.
foreach my $param_name ($cgi->param) {
print $cgi->hidden($param_name,$cgi->param($param_name));
}

I think the below should work:

foreach my $param_name ($cgi->param) {
print $cgi->hidden($param_name);
}

CGI.pm supports "sticky fields", which means if you used CGI both to
parse the submitted form and print a new form, it automatically uses
the values of just-parsed elements to populate the newly printed ones with
the same name.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top