Closed
Bug 242557
Opened 20 years ago
Closed 8 years ago
If I have a hidden field and it is accessed in a event of a tag <a href ...> it fails
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: jc104, Assigned: jst)
References
()
Details
(Keywords: regression, Whiteboard: regression from bug 147058)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040421 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040421 for example I have the next variable <form name="form1" method="post" action="main.jsp"> <input name="hago" type="hidden" value=""> if I do the next item variable <input type="button" name="Button" value="<<" class="inputButton" onClick="hago.value='<<'; submit();"> and its work fine but if i have the next <a href="#" onClick="hago.value='load'; submit();"> << </a> this do not work and i see the javascript console and report hago is undefined Reproducible: Always Steps to Reproduce: 1.declare a input hidden 2.uses this input hidden in an event of a tag <a href> 3. Actual Results: the page does not do nothing the java script console shows that the field is undefined Expected Results: perform then event onclick
Comment 1•20 years ago
|
||
Nothing to do with form submission. jst, this sounds like that scope chain thing that we removed... did we hack in something for inputs?
Assignee: form-submission → general
Component: HTML: Form Submission → DOM: Level 0
QA Contact: ian
Assignee | ||
Comment 2•20 years ago
|
||
Hmm, yeah... Form controls have their form as their JS parent, other nodes have the document as their JS parent, thus form controls will only appear in the scope of forms or form controls, not links. I wonder if IE special cases links here, or if anything in a form gets the form as its JS parent? We could make the code that finds the JS parent look up the parent chain for an HTML form element, and if it finds one, use it. But that could hurt performance if we do it across the board... Thoughts?
Comment 3•20 years ago
|
||
Juan, if you replace the <a> with a <div> in IE (and leave the onclick handler on the div), what happens?
Reporter | ||
Comment 4•20 years ago
|
||
In IE it works equals with the tag <div> as the tag <a>, I update the test page in the url there is the test with <a> with <div> and with <input type button>
Comment 5•20 years ago
|
||
What is window.xjc in IE?
Reporter | ||
Comment 6•20 years ago
|
||
xjc is the name of the hidden field, if you see the source code there is, the form is named "jc" and the input hidden is named "xjc"
Comment 7•20 years ago
|
||
Yes, I know it's the name. That doesn't answer my question. What does "window.xjc" evaluate to in IE on that document, especially when evaluated from script that is not a child of the form?
Comment 8•20 years ago
|
||
*** Bug 247745 has been marked as a duplicate of this bug. ***
Comment 9•20 years ago
|
||
So how much would it really hurt to look for a form? We used to do it, no? Before bug 147058 landed?
Updated•20 years ago
|
Keywords: regression
Assignee | ||
Comment 10•20 years ago
|
||
Shouldn't be too bad if we do it only for links...
Comment 11•20 years ago
|
||
I'd say let's just do links.
Comment 12•20 years ago
|
||
Well, doing just links won't help bug 253267 and bug 253091. I'm marking this confirmed; whatever's going on we're breaking a sites that used to work and that work with IE.....
Comment 13•20 years ago
|
||
In this DOM level 0 territory, it seems to me we have to do what IE did. Netscape 4 is too old, and it lacked onclick for divs and such. How hard can it be? /be
Comment 14•20 years ago
|
||
Brendan, as I understand it bug 147058 was fixed to give us IE compat on a different set of testcases.... So apparently, it's hard. Step one is to figure out what it is IE is doing.
Comment 15•20 years ago
|
||
*** Bug 254418 has been marked as a duplicate of this bug. ***
Comment 16•20 years ago
|
||
This bug and its dependancies should be retested now that bug 256932 has been fixed. Chances are, a lot of the testcases suddenly work now...
Keywords: qawanted
Comment 17•20 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041024 I don't see any improvements for any of the dependant bugs. :(
Comment 18•20 years ago
|
||
Indeed.... See bug 264247 comment 6. In short, the fix for bug 256932 doesn't apply to inputs.
Comment 19•19 years ago
|
||
Could we decide something here one way or another and maybe implement it in 1.9?
The most logical thing (and therefor easiest to understand) is probably to make everything inside a form use the form as the parent. This way peoples stuff won't break just because they change a tagname from <a> to <div>. Of course, there is the issue of performance. Walking up the parent chain is pretty cheap these days though since nsIContent::GetParent is non-virtual and inline.
Comment 21•19 years ago
|
||
*** Bug 312523 has been marked as a duplicate of this bug. ***
Updated•19 years ago
|
Flags: blocking1.9a1?
Updated•18 years ago
|
Flags: blocking1.9a1? → blocking1.9+
Summary: If I have a hidden field and it is accesed in a event of a tag <a href ...> it fails → If I have a hidden field and it is accessed in a event of a tag <a href ...> it fails
This isn't really blocking, but it'd be nice to fix. Jst thinks the perf hit wouldn't be too bad, but the problem might be that none of our tests would see it. Though dHTML might catch it.
Assignee: general → jst
Flags: blocking1.9+ → blocking1.9-
Whiteboard: regression from bug 147058 → regression from bug 147058 [wanted-1.9]
Comment 23•17 years ago
|
||
window.xjc in IE is null. Looks like IE really is just putting the <form> element into the scope chain of anything with a <form> descendant. That's annoying.
Updated•17 years ago
|
Flags: wanted1.9+
Whiteboard: regression from bug 147058 [wanted-1.9] → regression from bug 147058
Updated•15 years ago
|
QA Contact: ian → general
Comment 25•8 years ago
|
||
Cannot reproduce Version 50.0a1 Build ID 20160715063552 User Agent Mozilla/5.0 (Windows NT 5.1; rv:50.0) Gecko/20100101 Firefox/50.0
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•