Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Question about cgi forms (slightly OT)
I am developing a cgi/DBI app which is nearly finished

I have this one question

The scenario

I have a cgi generated form on a web-page, it consists of several
records defined by a DB lookup.

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

thanks for any tips (and apologies for vaguely OT)

Report this thread to moderator Post Follow-up to this message
Old Post
Mike
03-27-04 04:14 AM


Re: Question about cgi forms (slightly OT)
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

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

Report this thread to moderator Post Follow-up to this message
Old Post
Wc -Sx- Jones
03-27-04 04:14 AM


Re: Question about cgi forms (slightly OT)
On Thu, 2004-03-25 at 13:18, WC -Sx- Jones wrote:
> mike wrote:
> 
>
>
> 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,descriptio
n,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-co
lor: #C59E65;color: white');
print "Type of
Contact",textfield(-name=>'type'.$id1,-value=>$type,-style=>'background-colo
r: #C59E65;color: white');
print
"priority",textfield(-name=>'priority'.$id1,-value=>$priority,-style=>'backg
round-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

Report this thread to moderator Post Follow-up to this message
Old Post
Mike
03-27-04 04:14 AM


Re: Question about cgi forms (slightly OT)
mike wrote:

> 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

I was afraid that was what you meant.  :)

It is totally OT now because what you want is to chamge / control
the client side and you can't -- unless you do what the OP
stated - explode the current/old values out beside the input
fields as plain text.

Otherwise you will need client-side JS and DCOM programming; see

http://www.mozilla.org/projects/xpc...rnet.com/forms/

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

Report this thread to moderator Post Follow-up to this message
Old Post
Wc -Sx- Jones
03-27-04 04:14 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:06 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.