Get the ID value of a form tag on submit

Hi All

How can get the “ID value” of a form tag on submit.

INCOMING HTML FORM TAGS:
<INPUT ID="5625" Name="QualityItem1" Type="Radio" Value="Poor">
<INPUT ID="5650" Name="QualityItem2" Type="Radio" Value="Good">
<INPUT ID="5675" Name="QualityItem3" Type="Radio" Value="Excellent">

RETURNED VALUES WANTED:
ID|5625|QualityItem1|Poor
ID|5650|QualityItem2|Good
ID|5675|QualityItem3|Excellent
blnukemAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZiaTioNCommented:
A couple of things,

You can get the id tag value by appening it to the value tag and then split it when you receivbe it on the other end.

Ex:
<INPUT ID="5625" Name="QualityItem1" Type="Radio" Value="Poor::5626">

Script:
my ($val, $id) = split(/\:\:/, param('QualityItem1'));

There is no direct way to obtian that value through CGI.pm or even using $ENV{'QUERY_STRING'}.  This is due to the way both these methods receive this data.  Basic html parameter passing is done in a key, value pair encoded in the url (?key=value&key2=value2).  The "name" attribute is the key and the "value" attribute is the value.  The id attribute in a form element is for CSS type formatting.

Second, you are using radio buttons and have the names different in all objects.  Radio buttons are designed to represent the same name parameter and only allow a single one checked at a time.  If this is not the effect you are going for you should use checkboxes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.