Page 1 of 1
Accessing the id attribute of html element in PHP
Posted: Thu Jan 29, 2004 7:45 am
by vivekjain
Hi,
I would like to know if i can access the id attribute of html element in PHP. For eg <input type = button id = "bu">, i need to know if i can access the id from a PHP page, and if so how? thanks
Posted: Thu Jan 29, 2004 9:56 am
by markbeadle
As far as I know PHP builds the page (Server Side).
Only way of processing the id is to store necessary data for use later.
To access the information interactively using the ID you need to use client side information (i.e. Javascript).
Posted: Thu Jan 29, 2004 12:46 pm
by m3rajk
i'm curious about this as well since name is decremented in form elements (input, textarea, etc) in html4.01 and unsupported in xhtml... yet php doesn't grab them
Posted: Thu Jan 29, 2004 12:58 pm
by phpcoder
What about sending id vale in hidden field

Posted: Thu Jan 29, 2004 1:01 pm
by m3rajk
i think i'm off, or phpcoder is.
i was thinking attributed of elements... ie: element input
attributes name/id
eg: <input type="hidden" name="example" value="" id="example">
Posted: Thu Jan 29, 2004 1:04 pm
by Unipus
I don't understand the original point of this thread. Can you elaborate?
Posted: Fri Jan 30, 2004 2:55 am
by twigletmac
m3rajk wrote:i'm curious about this as well since name is decremented in form elements (input, textarea, etc) in html4.01 and unsupported in xhtml... yet php doesn't grab them
Just checked the XHMTL reference on
w3schools and it's got name supported in all XHTML doctypes including strict so I don't think it's going anywhere soon. The id is something different and should be unique for each element so if you have three radio buttons in a group they should have the same name but different id's.
Mac