Re: Question about cgi forms (slightly OT)
From: Mike (mike_at_redtux1.uklinux.net)
Date: 03/25/04
- Next message: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Previous message: Guruguhan \ N: "sorting multi dimensional array"
- In reply to: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Next in thread: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Reply: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Previous message: Guruguhan \ N: "sorting multi dimensional array"
- In reply to: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Next in thread: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Reply: Wc -Sx- Jones: "Re: Question about cgi forms (slightly OT)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|