Closed Bug 43786 Opened 25 years ago Closed 25 years ago

Cannot change form element value from Javascript

Categories

(Core :: Networking, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 41707

People

(Reporter: doog2, Assigned: gagan)

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m16) Gecko/20000613 BuildID: 2000061311 Mozilla is unable to change the value of a form element dynamically via javascript. Reproducible: Always Steps to Reproduce: 1.Create a form with a text input element (or hidden) 2.Write a javascript function to change the value 3.Call the javascript function in an <A HREF="javascript:function()" call 4.See that the form value doesn't change Actual Results: The text value does not change Expected Results: The text value should change Here is some code to reproduce: <script language = javascript> function testChange(testValue){ document.form1.test.value = testValue; } </script> <form name=form1> <input type=text name=test></input> <a href="javascript:testChange('FUBAR');">change</A> </form>
On 2000062408, I get a different behavior: When I clicked "change", I got into a new page with "javascript:testChange('FUBAR');" in the URL location bar. But when I clicked back, I got the old page back with the value changed as desired.
After looking into it further it appears that the culprit is a misplaced < /center> tag. If the </center> tag comes after the </form> tag, this bug appears. Here is the entire code to reproduce, by move the </center> tag one line up, the bug disappears... <html> <script language=javascript> function doSubmit(act){ document.form1.action.value = act; } </script> <head> <title>Test Page</title> </head> <body bgcolor="#7b68ee" alink="white" vlink="white" link="white"> <form name="form1" method="post"> <input type=text name="action"> <center> <a href="javascript:doSubmit('login');">test</A> </form> </center> </body> </html>
Assignee: rogerl → gagan,ruslan
Component: Javascript Engine → Networking
QA Contact: pschwartau → tever
The link under the "test" anchor is a JavaScript URL: javascript: doSubmit('login'); Currently, JavaScript URLs are not working.... Reassigning to Networking for disposition - is this a dup of, say, bug 41707?
I believe this is a duplicate of bug 41707. *** This bug has been marked as a duplicate of 41707 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Keywords: verifyme
Resolution: --- → DUPLICATE
Verified duplicate.
Status: RESOLVED → VERIFIED
this bug has an invalid owner. re-opening so i can reassign to a real person. (this bug is verified duplicate)
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---
reassigning to a real person
Assignee: gagan,ruslan → gagan
marking as a duplicate again *** This bug has been marked as a duplicate of 41707 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → DUPLICATE
re-verifying
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.