in reply to Re: Re: Re: Gas gauge ??
in thread Gas gauge ??
Thanks, I did check that out. Haven't heard of it before. Does it work a bit like the "DIV" in (inner)html ? For example
<html> <head> <title>Dropdown - Test #1</title> <link rel="stylesheet" type="text/css" href="default.css"> <script language="javascript"> function showCatInfo(index) { var prod = CategoryList[index]; div.innerHTML = '<h1>' + prod.name + '</h1>\n<p>$' + prod.pric +e + '</p>\n<p>' + prod.descr + '</p>'; } function showSubCatInfo(index) { var prod2 = SubCategoryList[index]; div2.innerHTML = '<h1>' + prod2.subcatid + '</h1>\n<p>$' + pro +d2.subcatname + '</p>\n<p>' + prod2.category_id + '</p>'; } var frm = null; var div = null; var div2 = null; function init() { frm = document.getElementById('frmInfo'); div = document.getElementById('divInfo'); div2 = document.getElementById('divInfo2'); getTypes(frm); getCategories(frm.selType.value); getSubCategories(frm.selCategory.value); } </script> </head> <body onLoad="init();"> <form id="frmInfo" name="frmInfo"> Category Groups: <select id="selType" name="selType" onChange="getCategories(this +.value)"> </select> Categories: <select id="selCategory" name="selCategory" onChange="getSubCate +gories(this.value)"> </select> Sub Categories: <select id="selSubCategory" name="selSubCategory" onChange="show +SubCatInfo(this.value)"> </select> </form> <div id="divInfo" name="divInfo">...</div> <div id="divInfo2" name="divInfo2">...</div> </body> </html>
The JS functions "showCatInfo" and "showSubCatInfo" would get called when a dropdown (list) changed, and the "innerhtml" code in those functions would display different messages. It was a nice method to have a 'block' of the form specifically assigned for messages. JS wouldn't need to run it though (events), as I assume Perl would be able to do the
div.innerHTML = '<h1>' + prod.name + '</h1>\n<p>$' + prod.price + '</p>\n<p>' + prod.descr + '</p>';
and thereby display a "Please wait" with colours, or have it appear to 'flash', by making the "div" blank, then pushing the text to it ?? These are all just ideas, I have no idea if that will work or if Perl can do that. But as the Perl script now puts out all sorts of HTML code, no doubt the 'DIV' (innerhtml) concept may work ??
Thanks,
Peter
|
|---|