Gossamer Forum
Home : General : Perl Programming :

greetings all

Quote Reply
greetings all
I have a question regarding the post and how it populates the QUERY_STRING hash. Basically w3c states that id is replacing name, however when I use ReadParse from

cgi-lib.pl (cgi-lib.pl,v 1.1 2001/04/17 16:04:30)

it just gets the name of the tag rather than the id. So i checked out the code in cgi-lib.pl and its a bit on the cryptic side of things. So I am not sure where they are grabbing the tag data and placing the name of the tag into the hash.

Anyways is there a way to get the id from a cgi post ? that is basically my question


Quote Reply
Re: [djorlett] greetings all In reply to
other poking around in the system has revieled to me, though it may have been obvious to some, that its not so much that the name is the only thing pulled of a DOM object, but rather that is the only indentifier that is available.

Anyone know how to override the parser for the post? or am I on my own with the whole writing new functionality. It seems to me that I am simply missing something simple, which would be nice as I preferr to use the id instead of name.

Thanks in advance if any who read this can find a solution.
Quote Reply
Re: [djorlett] greetings all In reply to
Is there any reason you are not using CGI.pm? cgi-lib is a bit on the old side. Check out the pod: http://search.cpan.org/...erl-5.8.1/lib/CGI.pm and see if it will fit your needs.

Quote Reply
Re: [djorlett] greetings all In reply to

First, I'd recommend you use CGI.pm instead of cgi-lib.pl. Second, post a sample of your code, it will help explain what you are trying to do.


Gossamer Threads Inc.
Quote Reply
Re: [Alex] greetings all In reply to
Right on,

Basically I am using an input for a form

Your Email Message:

<input id = "Email_Message" name = "Your Email Message" type = "text">

and a script check so the page does not need to refresh. Below is a sample of the script

<form method = "POST" action = "PostMail.cgi" onsubmit = "return CheckFields('Email_Message');">

var aFieldIds = CheckFields.arguments;

var sObject = document.getElementById(aFieldIds[iFieldIdx]);

if(sObject.value == "")

cErrorStr += sObject.name + "\n";

I use cgi to pull the form inputs with (ReadParse(\%hForm) or CGI::ReadParse(\%hForm) which both return the same information minus the fact that the CGI::ReadParse sorts the inputs) and what I get in the $ENV{'QUERY_STRING'} is the name as the key in the hash hForm.

My question is this, is there a way for me to tell HTTP::Form to read both the id and the name? or just the id?

from this documentation I see that its set as name here in the inputs area and I was hoping there was some way to set it up for it to read in both.

At the end of it I would like to be able to use id as the code identifier and name as some descriptor for the tag.

Hope that helps more.


Last edited by:

djorlett: Oct 15, 2003, 7:58 AM