Have you thought of doing named anchors?  (ie. <a name="anchor_name">)

If you use separate forms for each section, and direct them to the same
script except at the end of the action URL you add '#anchor_name' w/o the
quotes, the page should load up where you want it to.

I have a very simple script to show my point.

Go to --> http://test.jack-of-all-trades.net/cgi-bin/test.cgi

Notice that the page is just blank except for a submit button.  View the
source and notice the action URL of the form tag.  Also notice that the page
is completely blank save the submit button.  Click the submit button and you
will see what happens.

NOTE:  Make sure you use the POST method, or it may not work.  POST method
is the best way to go anyway, IMOHO.

Brad Handy
--www.jack-of-all-trades.net
[EMAIL PROTECTED]

> -----Original Message-----
> From: Chris Johnstone [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 31, 2001 3:52 PM
> To: Bradley M. Handy
> Subject: RE: PERL and JavaScript
>
>
> First of all I'm using the CGI.PM module to generate
> my CGI [which is all done using CGI.pm's functions].
>
> Anyways, the exact problem was this:
>
> I have a form with several "internal submission
> buttons". Then there is a "final submission button",
> which is for when you are entirely done.
>
> For these "internal submission buttons", I am using
> hidden fields to maintain state, and subroutines to
> rextract, sort, and edit the data found in them.
>
> Since my form is very large, it contains many subparts
> where "internal submission buttons" are needed; so
> when a user clicks an internal submission button, the
> data on the form is taken to the server and it does
> some processing and prints it out in the way the user
> would expect. However, the user was ALWAYS taken to
> the head of the form, no matter what clever trick I
> tried, rather then to the sub-section they were in [my
> form is all on 1 page, and when you submit it, it goes
> to a different page].
>
> After searching and searching and trying various
> things, I found that pulling JavaScript into my CGI.PM
> framework would enable me to do what I needed to do.
> So this bit of code did what I couldn'd do before:
> submit(-name=>'internalsubmission1',
>        -label=>'Submit a foo',
>
> -onClick=>"document.encode.action='#subsection1'");
>
> Heres an illustration, I hope this makes it clear:
> So a simple example would be a dynamic CGI page, where
> you have this
>
> Submit a number [_________] [SUBMIT NUMBER]
>
> Number summing goodness:
>     Number    Total
>       3          3                   *
>       4          7                   *
>      10         17                   *
>       5         22                   *
>
> Submit a word [___________] [SUBMIT WORD]
>
> Word alphabetizing coolness:
> apple,      [DELETE WORD] *
> avocado,    [DELETE WORD] *
> peach,      [DELETE WORD] *
> pear,       [DELETE WORD] *
> pineapple   [DELETE WORD] *
>
> * means that the content which appears in these areas
> relies on subroutines which sort, analyze data
>
> Hopefully you get the jist of this. I have just been
> making up my own techniques of generating content with
> CGI and I can't seem to find any text out there that
> goes beyond the beginner level :I
>
> Thanks
>
> Chris
> --- "Bradley M. Handy" <[EMAIL PROTECTED]>
> wrote:
> > What kind of problems were you having with Perl?
> >
> > Brad Handy
> > --www.jack-of-all-trades.net
> > [EMAIL PROTECTED]
> >
> >
> > > -----Original Message-----
> > > From: Chris Johnstone
> > [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 31, 2001 3:23 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: PERL and JavaScript
> > >
> > >
> > > I am a beginning PERL programmer working primarily
> > > with the CGI interface, and have just encountered
> > my
> > > first problem which I couldn't solve with PERL.
> > After
> > > about a solid week of trying different things, I
> > gave
> > > up and used a little JavaScript code. My question
> > is,
> > > do "professional" programmers working on large
> > > applications using the CGI interface oftern turn
> > to
> > > JavaScript, or do they try to solve everything
> > > internally with PERL?
> > >
> > > Chris Johnstone
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make international calls for as low as $.04/minute
> > with Yahoo! Messenger
> > > http://phonecard.yahoo.com/
> > >
> > > --
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to