hi...anyone got ideas on the drop down list and jgraph?actually everything goes well at first but after I add the drop down list code for selection to sort the graph based on year, the graph didn't show in the same page??anyone know how to solve this problem??

part of the code...

<form name="list_year" method="post" action="bargraph.php">  
    <img src="http://bytes.com/submit/image/Search-icon.gif" width="40" height="40" title="Search"/> 
        <select name="year" id="year" onchange="document.list_year.submit()"><option> -- select -- </option> 
        <?php  
            $sql = "SELECT DISTINCT year FROM user ORDER BY year ASC"; 
            $result = mysql_query($sql);  
  
            while($row=mysql_fetch_array($result, MYSQL_ASSOC)) 
            { 
                echo '<option value="'.$row['year'].'">'.$row['year'].'</option>'; 
            } 
       ?> 
        </select> 
            </form>  
  
      <p align="center"><img src="bargraph.php"></p> 
<input name="image" type="image" src="../image/print.png" width="50" height="50" title="Print" onClick="window.print()" alt="submit button"/>

thanks in advance.

Please make it: onchange="javascript:document.list_year.submit()" like this.

If you do not think that there is javascript error.means If above fails, you may produce the graph in a separate php file based on year, month and use jquery.com ajax to call the file on load and on subsequent call.

Please make it: onchange="javascript:document.list_year.submit()" like this.

If you do not think that there is javascript error.means If above fails, you may produce the graph in a separate php file based on year, month and use jquery.com ajax to call the file on load and on subsequent call.

thanks for the reply.ya, I don't think that is javascript error because I implement the same code for others functions and it is work fine. I think the code is crash with the code to display the jpgraph.does it means that the code for display the graph must be implemented alone?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.