I'm having some /more than likely logical/ problems with building and returning forms using CGI::Application::ValidateRM. This is a fairly new module to access Data::FormValidator using CGI::Application's interface.

The module looks good, and it looks like it will hoenstly work, but I've just got problems passing paramters around through CGI. So don't worry about the choice of module, but concentrate on how I'm /not/ passing arguments between subs.

_form_register_profile should pick up $q->param{email} from the form, but doesn't for some reason. Well the reason being that I haven't passed it, I'm sure -- but I need help on how to do this. If anyone understands my cryptic question-answering strategy and can help me out it'd be most appreciated.

###################################################################### +################# sub register_form { # -------------------------------------------------------------------- +------ # Output registration form. # my $self = shift; my $errs = shift; my $q = $self->query(); $self->set_session($q->cookie('SID')); my $lang_bit = $self->{session}{lang} || $q->param('lang'); my $tmpl_path = "dynamic/" . $lang_bit . "_" . "register.shtml"; my $tmpl = $self->load_tmpl($tmpl_path, die_on_bad_params => 0); $tmpl->param($errs) if $errs; return $tmpl->output; } ###################################################################### +################# sub register_process { # -------------------------------------------------------------------- +------ # Process registration form using CGI::Application::ValidateRM to c +heck # for blank required fields.. # my $self = shift; my $q = $self->query(); my ($results, $err_page) = $self->check_rm('register_form','_form +_register_profile'); return $err_page if $err_page; #.. do something with DFV $results object now my $lang_bit = $self->{session}{lang} || $q->param('lang'); my $tmpl_path = "dynamic/" . $lang_bit . "_" . "register_success.s +html"; my $tmpl = $self->load_tmpl($tmpl_path, die_on_bad_params => 0); return $tmpl->output; } ###################################################################### +################# sub _form_register_profile { # -------------------------------------------------------------------- +------ # Internal sub called from register_process to determine required # form variables for registration form. # return { required => 'email', }; } ###################################################################### +#################

Error Message:

[Wed May 14 19:10:33 2003] [error] Error executing run mode 'register_ +process'. Eval of code '$self->register_process' resulted in error: +Can't use an undefined value as a HASH reference at /usr/local/lib/pe +rl5/site_perl/5.6.1/Data/FormValidator/Results.pm line 570.
- wil

In reply to CGI Application and Forms by wil

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.