Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > web wizard question

Reply
Thread Tools

web wizard question

 
 
david
Guest
Posts: n/a
 
      09-15-2008
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
 
Reply With Quote
 
 
 
 
Peter Makholm
Guest
Posts: n/a
 
      09-15-2008
david <> writes:

> 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
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      09-15-2008
david <> wrote:
> 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.
 
Reply With Quote
 
david
Guest
Posts: n/a
 
      09-16-2008
On Sep 15, 7:53*pm, xhos...@gmail.com wrote:
> david <michaelg...@gmail.com> wrote:
> > 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 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

 
Reply With Quote
 
Bill H
Guest
Posts: n/a
 
      09-16-2008
On Sep 16, 3:25*am, david <michaelg...@gmail.com> wrote:
> On Sep 15, 7:53*pm, xhos...@gmail.com wrote:
>
>
>
>
>
> > david <michaelg...@gmail.com> wrote:
> > > 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.

>
> 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
 
Reply With Quote
 
xhoster@gmail.com
Guest
Posts: n/a
 
      09-16-2008
david <> wrote:
>
> 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.
 
Reply With Quote
 
david
Guest
Posts: n/a
 
      09-17-2008
On Sep 16, 5:36*pm, xhos...@gmail.com wrote:
> david <michaelg...@gmail.com> wrote:
>
> > 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 there5
> > 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.


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));
}
 
Reply With Quote
 
xhoster@gmail.com
Guest
Posts: n/a
 
      09-17-2008
david <> wrote:
> On Sep 16, 5:36=A0pm, xhos...@gmail.com wrote:
> > david <michaelg...@gmail.com> wrote:
> >
> > > 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=3DCGI->new;
> > #.....
> > print $cgi->hidden('param_name');
> >


(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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing what wizard to display (or wizard steps) based on a dropDownList value Andy B ASP .Net 0 04-19-2008 11:36 AM
ASP.NET Wizard with Wizard Steps being User Controls bhakta.ram@gmail.com ASP .Net 0 09-21-2006 06:36 PM
Visual InterDev 6 web project wizard and IIS question strutsng@gmail.com ASP General 1 09-30-2005 09:36 PM
Discreet 3ds Max v7.0, EDS.Unigraphics NX v3.0, bundled with Progressive.Die.Wizard, and Die.Design.Standard.Part.Library and Mold.Wizard, Cakewalk.SONAR 4 Producer Edition, Ableton.Live.v4.04, Arturia.CS80.V.v1.2, Pinnacle Studio Plus.v9.3 1, Systra astra35 NZ Computing 0 10-15-2004 11:41 AM
WinXP Microsoft Photo Printing Wizard, and Scanner and Camera Wizard Orak Listalavostok Digital Photography 5 07-10-2004 07:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57