|
Posted by Ed Jay on 11/18/25 11:31
"Jonathan N. Little" <lws4art@centralva.net> wrote:
>Ed Jay wrote:
>> Guillaume <nospam@nospam.com> wrote:
>>
>>
>>>Ed Jay:
>>>
>>>>1. How can I either test the error while still on Page 1?
>>>
>>>Javascript
>>>
>>>
>>>>2. How do I test for the Page 1 error on Page 2 and automatically return
>>>> the op to Page 1 for corrections?
>>>
>>>Redirect (set the appropriate headers + eventualy javascript code)
>>
>>
>> Understood; however, I either have to regenerate Page 1 with a new error
>> message, or stop at Page 2 with the error message and then resubmit to
>> Page 1 with all the 'good' variables intact and figure out how to
>> check/uncheck checkbox buttons on Page 1.
>>
>> I may have figured an easy solution explained in my very recent post in
>> response to mbstevens, i.e., print the error message on Page 2 and use
>> javascript to return the guy to Page 1 as held in the cache. The only
>> issue I see with this method is unchecking the checkboxes or radio buttons
>> that were incorrectly checked.
>>
>
>
>Normally I would approach a multi-page form with a single Perl script,
>which posts back to itself on each step. Process the query in a matrix
>before generation of the page so if the 1st page's fields pass muster it
>will then generate the 2nd page's form with 1st page's fields in hidden
>fields, if not then regenerate 1st page with bad fields marked. And then
>so on for each page. Than I add a JavaScript validation for each page so
>IF the visitor has JavaScript enabled, the script can interrupt the
>submission and alert the error fields without a server call. A nice
>option but not required because it will be validated again by the CGI.
I started with a single Perl script, but when it reached the 100kB level,
I decided that in the interest of saving time, I'd better break it into
smaller modules. (The sum of 6 modules is now up to 250kB. It's going to
get bigger yet.)
Anyway, I solved my issue as explained to mbstevens.
--
Ed Jay (remove M to respond by email)
Navigation:
[Reply to this message]
|