Cannot change form element value from Javascript

VERIFIED DUPLICATE of bug 41707

Status

()

P3
normal
VERIFIED DUPLICATE of bug 41707
19 years ago
10 years ago

People

(Reporter: doog2, Assigned: gagan)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
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>

Comment 1

19 years ago
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.
(Reporter)

Comment 2

19 years ago
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>

Updated

19 years ago
Assignee: rogerl → gagan,ruslan
Component: Javascript Engine → Networking
QA Contact: pschwartau → tever

Comment 3

19 years ago
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?

Comment 4

19 years ago
I believe this is a duplicate of bug 41707.

*** This bug has been marked as a duplicate of 41707 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 19 years ago
Keywords: verifyme
Resolution: --- → DUPLICATE

Comment 5

19 years ago
Verified duplicate.
Status: RESOLVED → VERIFIED

Comment 6

19 years ago
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 → ---

Comment 7

19 years ago
reassigning to a real person
Assignee: gagan,ruslan → gagan

Comment 8

19 years ago
marking as a duplicate again

*** This bug has been marked as a duplicate of 41707 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 19 years ago19 years ago
Resolution: --- → DUPLICATE

Comment 9

19 years ago
re-verifying
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.