Form#_nextField submit() expando error
Reported by Stephen Elson | July 17th, 2009 @ 01:46 PM | in 1.7
Form#_nextField
should check that
this.formNode[0].submit
is a function + hasn't been
overwritten by element with name="submit". It should probably throw
a meaningful error
Comments and changes to this ticket
-
Stephen Elson July 17th, 2009 @ 01:51 PM
- Milestone changed from 1.6 to 1.7
-
Stephen Elson July 18th, 2009 @ 09:54 AM
- Tag set to defect, forms
-
Stephen Elson July 24th, 2009 @ 03:04 PM
- State changed from new to accepted
-
Michael Mathews September 1st, 2009 @ 12:39 PM
- Assigned user set to Michael Mathews
-
Michael Mathews September 1st, 2009 @ 02:55 PM
I can't reproduce this problem. Is it browser-specific?
-
Jake Archibald September 1st, 2009 @ 03:04 PM
I wonder if we can fix this issue by moving the element with name/id "submit" outside of the form temporarily. We might be able to get hold of the Form#submit function.
-
Michael Mathews September 2nd, 2009 @ 09:42 AM
- State changed from accepted to open
Jake: your solution would certainly be nifty, but unfortunately it couldn't work all browsers. In my tests the expando behaves as a mask in IE7 and Opera9, that is, once you remove the input element you can then see the original submit again; but in Safari4 and FireFox3 the expando behaves as a replacement, meaning when you remove the input element the original submit is no longer there, as if it had been wiped out by the expando in the first place.
Given that your suggestion won't work in roughly half the browser cases I think we should just throw an error with a useful message explaining why we can't call the submit function.
-
Michael Mathews September 2nd, 2009 @ 11:09 AM
Just a note about the complexities involved: it is perfectly valid for a form to have multiple input elements of type "submit", and/or for an input element of type "checkbox" for example to be named "submit". In such a case trying to simulate a submit without the original form.submit function would be fail prone.
-
Stephen Elson September 2nd, 2009 @ 02:33 PM
- State changed from open to review
(from [ca7db2ff677acb48c6f65d8c652910b994ddbe7d]) Fixed bug that caused error when validating a form with an input element named "submit". [#29 state:review] http://github.com/glow/glow1/commit/ca7db2ff677acb48c6f65d8c652910b...
-
Michael Mathews September 2nd, 2009 @ 02:53 PM
I solved this by removing the call to form#submit() entirely, and replaced it with an approach that tracks the true/false value to return from the submit event handler. This seems to be immune to the expando issue.
-
Michael Mathews September 4th, 2009 @ 12:02 PM
- State changed from review to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A JavaScript Library
People watching this ticket
Referenced by
- 29 Form#_nextField submit() expando error (from [ca7db2ff677acb48c6f65d8c652910b994ddbe7d]) Fixed b...