Closed
Bug 43786
Opened 25 years ago
Closed 25 years ago
Cannot change form element value from Javascript
Categories
(Core :: Networking, defect, P3)
Tracking
()
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.
Reporter | ||
Comment 2•25 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•25 years ago
|
Assignee: rogerl → gagan,ruslan
Component: Javascript Engine → Networking
QA Contact: pschwartau → tever
Comment 3•25 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 6•25 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 8•25 years ago
|
||
marking as a duplicate again
*** This bug has been marked as a duplicate of 41707 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•