Bug 14898 - need way to prepopulate checkbox and multi-select fields on error
need way to prepopulate checkbox and multi-select fields on error
Status: CLOSED CURRENTRELEASE
Product: Red Hat Web Site
Classification: Red Hat
Component: Other (Show other bugs)
current
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lancaster
Paul Lindner
http://www.redhat.com/strategicservic...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-31 14:01 EDT by Maraya Cornell
Modified: 2007-04-18 12:27 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-11 19:20:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Maraya Cornell 2000-07-31 14:01:18 EDT
Regarding the form pane, /apps/formmail/.  When the user makes a mistake on 
a required field, he gets the form back with a message.  The pane allows 
Production to add some code to the form itself so that the form fields are 
prepopulated, and the user doesn't have to fill them all out again.  Except 
that there's no way to do this for checkboxes and multiselects.  This 
feature really does't do us much good unless we can prepopulate ALL of the 
fields.
Comment 1 Paul Lindner 2000-08-09 04:45:32 EDT
Tom, a hint from the modperl list....

See me about a way to use this idea with nifty Apache::ASP custom tags..



There is the HTML::FillInForm module that will pre fill your forms.
It is pure Perl.  It seems to work well, haven't stress tested it yet.

I am using it in conjunction with Apache::ASP, but haven't hacked
the Apache::ASP module to include it as a function.  It is much easier
to work with now that Joshua has added the $Response->TrapInclude
function (thank you).  I just keep my form in an include file, read it in to
my script/page
with the $Response->TrapInclude then send the it through HTML::FillInForm
with my values I want in the form.

This is all it takes -
use HTML::FillInForm;

my $fif = new HTML::FillInForm;

my $html = $Response->TrapInclude('dbd_form.inc');

my $output = $fif->fill(scalarref => $html,
                  fdat => \%form_content);

print "$output";
Comment 2 Tom Lancaster 2000-08-10 16:46:36 EDT
Fixed this using the Module Paul recommended HTML::FillInForm, though it needed
some patching to work properly on upper case HTML and checkboxes.
The new custom tag which should be used for forms needing this functionality is
<Apps:fillin></Apps:fillin>. This should surround the <form></form> tags.
I have applied this to the pages in apps/response ( the oracle and IA64 contact
forms ).
I noticed in doing this that the checkboxes on oracle_81contact.html didn't
appear to be right; there's a series of them with the same name and different
values, a la radio button. I'm not sure you're supposed to do that with
checkboxes. Correct me if I'm wrong, though.

I'll submit a separate bug for that one.
Comment 3 Maraya Cornell 2000-08-11 19:20:20 EDT
This isn't working for me. I've tried it with and without the perl code in the 
page. I think it's supposed to be without. I noticed that the <Apps:fillin> and <
/Apps:fillin> are still showing up in the source - shouldn't they have 
disappeared? Maybe something needs to be done to my sandbox to make that work?

I committed the page I'm working on:
http://sassy.soma.redhat.com:8500/apps/response/enroll_channel.html
Comment 4 Tom Lancaster 2000-08-11 19:38:51 EDT
I tihnk /apps/global.asa
and /home/httpd/lib/HTML/FillInForm ( plus HTML::Parser )
need to be updated on that machine. Paul??
Comment 5 Maraya Cornell 2000-08-11 19:55:52 EDT
No, those files are already updated. Are there any others I may be missing?

Note You need to log in before you can comment on or make changes to this bug.