Closed Bug 18626 Opened 25 years ago Closed 25 years ago

textarea.value returns empty string onload of document, even if we set defaultValue.

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
All
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: desale, Assigned: vidur)

Details

Attachments

(1 file)

textarea.value returns empty string onload of document, even if we set
defaultValue in HTML code. Once document is loaded then it starts
returning actual value.

BUILDS: 1999-11-11-09.

STEPS TO REPRODUCE:
1] Copy HTML code I'm providing. Save it as HTML file.
2] Open this HTML file with mozilla.exe with above specified builds.
3] As soon as you load page, you'll see one alert. Observe message on alert.
4] Click OK on this alert.
5] After loading page, you'll see one button "Show TextArea Value". Click this
button.
6] You'll see one alert. Observe message on alert.
7] Click OK on this alert.

EXPECTED RESULTS:
Both alerts should show same message [Since I'm calling same alert onLoad of
document, and onClick of button.]
It should show message like this both the times.
TextArea Value =  Initial Text For Textarea

ACTUAL RESULTS:
First alert shows,
TextArea Value =   [Which is wrong, since we are setting value to textarea in
HTML itself.]

Second Alert shows
TextArea Value =  Initial Text For Textarea [Which is offcourse correct.]

TESTCASE CODE START:

<html>
<head>
<title>Text Area Value</title>
</head>
<script type="text/javascript">
<!--
function showcheked(){
alert("TextArea Value = " + document.workform.testtxa.value );
}
//-->
</script>
<body onLoad="showcheked();">
<FORM NAME="workform">
<TEXTAREA NAME="testtxa" VALUE="testvalue" ROWS="5" COLS="50">
Initial Text For Textarea
</TEXTAREA><br>
<INPUT TYPE="button" NAME="testbut" VALUE="Show TextArea Value"
onClick="showcheked();">
</FORM>
</body>
</html>



TESTCASE CODE END:
OS: Windows 95 → All
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
This also works with the latest build. From the console window:

Browser Window Alert: TextArea Value = Initial Text For Textarea
Status: RESOLVED → VERIFIED
Verified with 12-14-09.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: