Re: Question about cgi forms (slightly OT)

From: Mike (mike_at_redtux1.uklinux.net)
Date: 03/25/04


To: beginners@perl.org
Date: Thu, 25 Mar 2004 13:44:38 +0000

On Thu, 2004-03-25 at 13:18, WC -Sx- Jones wrote:
> mike wrote:
>
> > When I do Search in the web-browser, is there any way to get it to
> > search the values in the fileds of the form?
> >
> > Currently all the values show up, but they dont seem to appear to be in
> > scope for searching
>
>
> Show some code -- likely your logic is wrong -- if using CGI module
> then capture all params in a single arrary, or hash, then walk
> thru the data.
>
> If you normalize the CGI input to a sane value (IE, make string zero
> numeric 0 and undefined input as empty strings) you can control
> the order they are placed into the array then you can use array
> index to make sure you are looking at the right array to CGI
> input values.
>
> HTH
>

dont think I was clear enough

this creates the form

print start_multipart_form (POST,'con_role_upd.pl');
print "Choose Id",textfield('id2','0');
print "<br />";
print "<BR />";
#@value=param();
#print @value;
$row1=$dbh->prepare("SELECT
tb_contact_role.id,contact_id,type_of_contact,description,priority FROM
tb_contact_role LEFT JOIN lk_sort_of_contact ON
type_of_contact=type_code WHERE contact_id ILIKE ?");
my $idsel=$id;
$row1->bind_param(1,$idsel);
$row1->execute();
while(($id1,$contact_id1,$type_id,$type,$priority) =
$row1->fetchrow_array()) {
#print $id1,$contact_id1,$type,$priority;
print font {-style=>'background-color: #F8FC8C;color: blue'};
print "Roles for Contact";
print end_font;
print p;
print font {-style=>'background-color: white;color: blue'};
print "Role
ID",textfield(-name=>'id1'.$id1,-value=>$id1,-style=>'background-color:
#C59E65;color: white');
print "Role
ID",textfield(-name=>'type_id1'.$id1,-value=>$type_id,-style=>'background-color: #C59E65;color: white');
print "Type of
Contact",textfield(-name=>'type'.$id1,-value=>$type,-style=>'background-color: #C59E65;color: white');
print
"priority",textfield(-name=>'priority'.$id1,-value=>$priority,-style=>'background-color: #C59E65;color: white')};
print br;
print br;
print br;
}
print submit;
print end_form;

This results in a html page of forms which is populated, I can tab
through the fields, edit etc, but if I do a control F for instance, the
values in the fields are not found.

What I would like is for users to be able to search for a value and then
go tothat record

> --
> _Sx_ http://youve-reached-the.endoftheinternet.org/ _____
> perldoc -qa.a | perl -lpe '($_)=m("(.*)")' | grep Martian



Relevant Pages

  • Re: Question about cgi forms (slightly OT)
    ... > Currently all the values show up, but they dont seem to appear to be in ... If you normalize the CGI input to a sane value (IE, make string zero ... the order they are placed into the array then you can use array ...
    (perl.beginners)
  • Re: How to create an array of images
    ... > How should I do to create an array of all my image objects found at my ... I dont understand why? ... ONE Image control would suffice. ...
    (microsoft.public.vb.general.discussion)
  • Re: PHP-like Array/Hash creation in Ruby
    ... but the autogrowing is limited to the last dimension. ... i dont have constant size of elements that could be added in just one ... want to store them in a 3 dimensional array. ... I do like Ruby very much from the first looks ...
    (comp.lang.ruby)
  • Re: playlistCollection.remove fails with invalid procedure call ..
    ... No web control present. ... If I dont ... >>I have a media player control in a vb6 form. ...
    (microsoft.public.windowsmedia.sdk)
  • Re: People in Denial
    ... The only person you can control is ... Your family is grossly overweight and inactive and if they dont help ... Your mother needs better care. ... In tribute to the United States of America and the State ...
    (alt.support.diabetes)

Loading