W3C home > Mailing lists > Public > www-html@w3.org > April 2007

Re: SELECT with arbitrary input and buttons with values separated from text is possible?

From: Sebastian Mendel <lists@sebastianmendel.de>
Date: Wed, 25 Apr 2007 15:10:45 +0200
Message-ID: <462F5355.20701@sebastianmendel.de>
To: w3c@dv-life.ru
CC: www-html@w3.org

w3c@dv-life.ru schrieb:

> 1. Buttons. Why the value of a button control is equal text on the button?
> I can have 100 button
> with text "Submit" in different pages of my app, but for parsing $_POST
> array in PHP i want different
> names, that can hint me what action exactly PHP script must perform. Why
> it's not possible
> to write <input type=submit name=action_but value=add_user text=submit> ?
> Now i use union of name and value in name, like <input type=submit
> name=action_but_add_user text=submit>,
> and i am compelled to use additional searching by pattern and parsing
> undefined $_POST key, instead of using
> simple check like if ($_POST['action_but']=='add_user').

you should improve you PHP skills ...

and for example use arrays

<input type="submit" name="action[add_user]" value="submit" />

and check for for the keys in the given array



sorry for being OT!

-- 
Sebastian Mendel

www.sebastianmendel.de
Received on Wednesday, 25 April 2007 13:08:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:09 GMT