[Solar-talk] Isn't 'submit' a bad name for form fields?
Rodrigo Moraes
rodrigo.moraes at gmail.com
Fri Jan 5 09:01:36 PST 2007
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).
What I'm suggesting is, although they are configurable, it would be
good to change the default name for the submit button in the classes
(particularly 'source_submit' in Solar_Auth - I think it is the only
place. hehe. anywhere else?) to make they *by default* more friendly
to javascript events. It would be good to do the same in the bundled
apps as a good practice example, though.
rodrigo
More information about the solar-talk
mailing list