[MAGNOLIA-270] Dialog field can not be named submit Created: 21/Jan/05  Updated: 23/Jan/13  Resolved: 16/May/06

Status: Closed
Project: Magnolia
Component/s: templating
Affects Version/s: 2.0 Final
Fix Version/s: 3.0 RC1

Type: Bug Priority: Minor
Reporter: Ortwin Glueck Assignee: Philipp Bärfuss
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If you define a dialog that contains an input field named 'submit' the dialog submit button does not work anymore.



 Comments   
Comment by Erik Gulliksen [ 21/Jan/05 ]

Not quite sure, but i think this is a browser issue that makes it hard to code for...
Like
document.forms["name"].submit()
vs.
document.forms["name"].submit
(the object created if u name a field item "sumbit")..

Naming a field "submit" is in general bad idea.

posible sulution is to make some test and/or insert some prefix or something.

....or just dont use submit as a name

Comment by Ortwin Glueck [ 21/Jan/05 ]

To access a field named 'submit' the following code should be used:
document.forms["name"].elements["submit"]

Still I know that JavaScript produces name clashes like this per definition.

Like:
<form action="my.htm" name="myform">
<input type="hidden" name="action" value="myaction">

would hide the action attribut in the form tag and make it inaccessible:
document.forms["myform"].action would always refer to the input field.

Maybe the same thing holds true for the above case where:

<form action="my.htm" name="myform">
<input type="hidden" name="submit" value="myvalue">

would hide the submit method of the form object.

Comment by Erik Gulliksen [ 21/Jan/05 ]

yes it was what i meant..

I just know i had some issues with it before. If i wanted to submit the form with a "submit" field in it, it thinks i am trying to access the field not the method.

as fare as i can recall anyway

(If for som reason u have to use that paramerter for an external application, maybe it can be addressed in the action attribute on the form element. like:

<form action="externalAddress.jsp?submit=Send" ..>

Well just an idea anyway..
)

Comment by Philipp Bracher [ 16/May/06 ]

this not realy an issue. Isn't it?

Generated at Mon Feb 12 03:15:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.