[Solar-talk] Isn't 'submit' a bad name for form fields?
Paul M Jones
pmjones at ciaweb.net
Fri Jan 5 09:05:01 PST 2007
On Jan 5, 2007, at 11:01 AM, Rodrigo Moraes wrote:
> Just in case this was not clear, I made a simple example to
> demonstrate where is the problem:
>
> 1. Some forms in Solar apps are generated with the submit button with
> name and id 'submit'. Any event that try to submit the form will have
> a problem:
> <form action="" method="post">
> <input type="text" name="handle" value="" size="10" />
> <input type="submit" name="submit" id="submit"
> value="submit" />
> <a href="#" onclick="this.parentNode.submit();">created
> submit</a>
> </form>
>
> 2. If the name *and* id are something else, there is no problem:
> <form action="" method="post">
> <input type="text" name="handle" value="" size="10" />
> <input type="submit" name="submit-auth" id="submit-auth"
> value="submit" />
> <a href="#" onclick="this.parentNode.submit();">created
> submit</a>
> </form>
>
> The example above makes no sense as a real world case but serves for
> demonstration (the real case is: I have forms generated in the DOM and
> need to manipulate them using javascript events).
I see your point.
What's a good default alternative?
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Join the Solar community wiki! <http://solarphp.org>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list