[ic] how to acces form fields..

Eduardo Dominguez interchange-users@interchange.redhat.com
Tue Sep 25 17:30:01 2001


I found wath my problem really is, although I havent figured out
how to solve it.

I have a page called add_comments.html. In it I have a form
with a mv_click called update_database.
In the same page I have a [set update_database], which will handle
the form. I also have:

     <INPUT TYPE=hidden NAME="mv_todo" VALUE="return">
      <INPUT TYPE=hidden NAME="mv_nextpage" VALUE="comment_stored">

On the comment stored page I display the result of the form processing
that its done by the [set update_database] block. For testing purposes
I set a scratch var to the sql statement.

If I try to add a comment, I end up in the "comment_stored" page, which
is the desired result, BUT the sql contains nothing but empty records.
This is how I build the sql query.

my $sql = sprintf('INSERT INTO comments(sku,name) VALUES("%s","%s")',
$Values->{cmnt_sku}, $Values->{cmnt_fullname});

If I do a browser back button, change some values of the form and do a
submit, the record gets inserted, with the values of the first form. 
Seems like the db insert gets done before the $Values get updated.

How can I fix this ?

Thanks in advance.

On Tue, 2001-09-25 at 15:11, Ed LaFrance wrote:
> At 02:51 PM 09/25/2001 -0500, you wrote:
> >I want to process a form, validate it and if it meets certain
> >criteria, store it in a DB.
> >
> >I am using perl to store to do this. How do I access the form
> >fields ?
> >
> >Using [value..] or [cgi..] doesnt work. What should I use
> >to retrieve those values ?
> >
> 
> I assume you mean you are using [perl ..][/perl]?  You would do something like:
> 
> [perl]
>          my $foo = $CGI->{foo};
>          # ...or...
>          my $bar = $Values->{bar};
> [/perl]
> 
> Take a look at these docs for more info:
> http://ic.redhat.com/cgi-bin/ic/dev-4.8/ictemplates_15.html
> http://ic.redhat.com/cgi-bin/ic/dev-4.8/ictemplates_31.html
> http://ic.redhat.com/cgi-bin/ic/dev-4.8/ictemplates_40.html
> 
> 
> - Ed L.
> 
> 
> 
> ===============================================================
> New Media E.M.S.               Software Solutions for Business
> 463 Main St., Suite D          eCommerce | Consulting | Hosting
> Placerville, CA  95667         edl@newmediaems.com
> (530) 622-9421                 http://www.newmediaems.com
> (866) 519-4680 Toll-Free       (530) 622-9426 Fax
> ===============================================================
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com