RE: Re: Parsing of forms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19 May 2009 17:10, Andrew Ballard advised:

> On Tue, May 19, 2009 at 10:11 AM, Ford, Mike
> <M.Ford@xxxxxxxxxxxxxx> wrote:
>> On 19 May 2009 14:37, Daniele Grillenzoni advised:
>> 
>>> 
>>> My complaint is this: a I can have a select multiple with a normal
name,
>>> which is allowed by every spec, but PHP requires me to use [] in
order
>>> to properly retrieve the values.
>> 
>> I really don't understand the problem with this -- in fact, I find it
>> quite useful to distinguish inputs which may have only 1 value from
>> those which may be multi-valued. And it all depends on what you mean
by
>> a "normal" name, of course -- no current (X)HTML spec disallows [] as
>> part of a name attribute, so in that sense a name containing them
could
>> be seen as perfectly normal...!! ;) ;)
>> 
>> Can you explain why this is such a hang-up for you, as I haven't seen
>> anything in what you've posted so far to convince me it's any kind of
>> problem? 
>> 
>> Cheers!
>> 
>> Mike
>> 
> 
> I can't speak for the OP, but I've always thought it somewhat odd. An
> HTML form should be able to work correctly without modification
> regardless of the language that receives the input. As it is, it makes
> the HTML for a form implementation specific. You might be able to use
> ASP correctly process a form originally targeted toward PHP, but you
> could not similarly take a form designed for ASP and process it with
PHP
> without modification.

Humph! Yes, ok, I concede this point. I also bow to Daniele's need to
process forms designed by someone else with (not-PHP) in mind. Actually,
I can see the validity of both sides of the argument, and I teeter on
the fence as to whether  the [] method is "right" or not!! ;)

> 		var toppings = document.sundae.toppings;
>                 // To work with PHP, the above line would
> have to be changed:
>                 // var toppings =
> document.sundae.elements['toppings[]'];

Actually, document.sundae['toppings[]'] is sufficient (because it is
defined in JavaScript that a['b'] is always exactly equivalent to a.b).

Cheers!

Mike

 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 812 4730



To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux