dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 03 2003 at 14:10 | IP Logged
|
|
|
Tony,
Your action of "macro(id.value)" is not correct. The action for a form must be a new webpage. I think what you may have been trying to do is: "/ph-cgi/playmacro". This is still not what you would want however because the next webpage loaded by the "playmacro" would be the main page. You could probably accomplish what you want to do with:
<form method="post" action="ph-cgi/execsendkeys">Macro: <select name="sendkeys" size=1> <option value="ph_rtne(0)"> <option value="ph_rtne(ph_macro('AMP OFF'))">AMP OFF <option value="ph_rtne(ph_macro('AMP ON'))">AMP ON <option value="ph_rtne(ph_macro('BYE'))">BYE </select> <input type="submit" value="Play"> <input type="hidden" name="nexturl" value="whatever this page is"> </form>
Now if you wanted to get a little fancier, you could use something like the code below so that the page doesn't have to refresh everytime.
<html> <head> <title>PowerHome</title> <script language="JavaScript"> <!-- function openskwin() { var skwin; skwin=window.open('about:blank','SKWin','width=100,height=100,location=no,menubar=no,titlebar=no,status=no,toolbar=no,scrollbars=no,resizable=no,top=100,left=100',true); skwin.blur(); } // --> </script> <body onload="openskwin()"> <form name="Form1" method="post" target="SKWin" action="ph-cgi/execsendkeys">Macro: <select name="sendkeys" size=1> <option value="ph_rtne(0)"> <option value="ph_rtne(ph_macro('AMP OFF'))">AMP OFF <option value="ph_rtne(ph_macro('AMP ON'))">AMP ON <option value="ph_rtne(ph_macro('BYE'))">BYE </select> <input type="hidden" name="nexturl" value="about:blank"> <input type="button" value="Play" onclick="document.Form1.submit();self.focus();"> </form>
Dimming and brightening would be accomplished in a similar manner such as outlined below:
<html> <head> <title>PowerHome</title> <script language="JavaScript"> <!-- function openskwin() { var skwin; skwin=window.open('about:blank','SKWin','width=100,height=100,location=no,menubar=no,titlebar=no,status=no,toolbar=no,scrollbars=no,resizable=no,top=100,left=100',true); skwin.blur(); } // --> </script> <body onload="openskwin()"> <form name="Form1" method="post" target="SKWin" action="ph-cgi/execsendkeys">A1 Level: <select name="sendkeys" size=1> <option value="ph_rtne(0)"> <option value="ph_rtne(ph_x10(1,'A',1,0) + ph_x10(1,'A',105,100))">100% <option value="ph_rtne(ph_x10(1,'A',1,0) + if(ph_getx10level('A',1) > 75,ph_x10(1,'A',104,ph_getx10level('A',1) - 75),ph_x10(1,'A',105,75 - ph_getx10level('A',1))))">75% <option value="ph_rtne(ph_x10(1,'A',1,0) + if(ph_getx10level('A',1) > 50,ph_x10(1,'A',104,ph_getx10level('A',1) - 50),ph_x10(1,'A',105,50 - ph_getx10level('A',1))))">50% <option value="ph_rtne(ph_x10(1,'A',1,0) + if(ph_getx10level('A',1) > 25,ph_x10(1,'A',104,ph_getx10level('A',1) - 25),ph_x10(1,'A',105,25 - ph_getx10level('A',1))))">25% </select> <input type="hidden" name="nexturl" value="about:blank"> <input type="button" value="Set Level" onclick="document.Form1.submit();self.focus();"> </form> </body> </html>
Hope this helps .
Dave.
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 05 2003 at 07:02 | IP Logged
|
|
|
Okay, here goes!
First, I created a function...
function dim(hc, uc, value) { document.execsendkeys.sendkeys.value = "ph_rtne(ph_x10btn('" + hc.toUpperCase() + "','" + uc + "',100, '" + value + "'))"; document.execsendkeys.submit(); }
Then, in my page, I do this...
<form name="dim1"> <select name="id" size=1> <option value=""> <option value="100">100% <option value="50">50% </select> <input type="button" value="ADim" onclick="dim('a', 8, document.dim1.id.value)"> </form>
No luck! I think I'm close!
Tony
|