i have thoroughly searched similar case before opening couldn't found answer.
scenario: trying create list of links internal js function set input of form , post php page responsible rendering graphs. each link pass different parameter (namely cidr address) said function.
problem: links correctly created and, if hover on them, see right parameter being passed but... function won't work. it's not logic within it, seems not being called @ all. if put simple alert("test");
inside it, function not executed.
question: considering below code, can cause this?
<script type="text/javascript"> function getgraph(ip){ document.getelementbyid('graph').ipaddr.value = ip; document.getelementbyid('graph').submit(); } </script> ... <form id="graph" target="_blank" action="./graphs.php" method="post"> <input type="hidden" name="ipaddr" value=""> </form> ... <?php ($row_no = $ev_ips->num_rows - 1; $row_no >= 0; $row_no--) { $ev_ips->data_seek($row_no); $row = $ev_ips->fetch_assoc(); $cidr = long2ip((float)$row['ip'])."/".$row['netmask']; $cidrlink = "<a href=\"javascript:getgraph(".$cidr.");\">".$cidr."</a>"; $dest_ips = $dest_ips.$cidrlink.", "; } ?> ... <?php echo rtrim($dest_ips,", "); ?>
Comments
Post a Comment