Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem display field

Status
Not open for further replies.

pho01

Programmer
Joined
Mar 17, 2003
Messages
218
Location
US
I'm designing a fieldset to display/not display barchart by clicking on a button. Would someone tell me what is missing here, when i click on the button, it said "object expected". I can't see what is missing!

<SCRIPT language="javascript">
function drawChart()
{
var chart = document.form.getElementsByTagName("fieldset");
chart.style.display = "inline";
}
</SCRIPT>


<form method="POST" action="someaction" name="Form" >

<!--...-->


<td><input type=button name="sub1" value="Get Data" onclick="drawChart()"></td>

<fieldset id="chart1" style="display:none">
<!--
html contains table and chart
-->
</fieldset>


How would you debug javascript embedded into html?
Thanks!
 
Try treating the chart variable you get with document.getElementsByTagName() as an array, then loop through the array and process each element in the array individually.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top