Jump to content

Can't figure out how to click on button with IE.au3


VeeDub
 Share

Recommended Posts

Hi,

I'm trying to work with a NAS device that has a Web interface.

I can login OK and navigate to the menu that I want, where there are 2 buttons: Reboot and Shutdown. I want to write a script that will click on the shutdown button.

I have tried using _IEImgClick, _IEFormImgClick (which is the command I thought should work as the buttons are on a form: sdrbform, and _IELinkClickByText - unfortunately none of these attempts has worked.

The NAS device is not accessible from the Net, hopefully the source will provide enough info for someone to suggest a different approach to try.

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link rel=stylesheet href="/pub/style.css" type="text/css">
<script language="javascript" src="/pub/form.js"></script>
<script language="javascript" src="/pub/loading.js"></script>
<!--MENU--><link rel="stylesheet" href="/adm/menu/layersmenu-demo.css" type="text/css"></link>
<link rel="stylesheet" href="/adm/menu/layersmenu-gtk2.css" type="text/css"></link>
<script language="Javascript" type="text/javascript" src="/adm/menu/libjs/layersmenu-browser_detection.js"></script>
<script language="Javascript" type="text/javascript" src="/adm/menu/libjs/layersmenu-library.js"></script>
<script language="Javascript" type="text/javascript" src="/adm/menu/libjs/layersmenu.js"></script>



<script language="Javascript" type="text/javascript">
<!--

menuTopShift = 6;
menuRightShift = 7;
menuLeftShift = 1;

var thresholdY = 2;
var abscissaStep = 140;

toBeHidden = new Array();
toBeHiddenLeft = new Array();
toBeHiddenTop = new Array();

listl = ['L1','L4','L8','L11','L15'];
var numl = listl.length;

father = new Array();
for (i=1; i<=24; i++) {
    father['L' + i] = '';
}
father_keys = ['L2','L3','L5','L6','L7','L9','L10','L12','L13','L14','L16','L17','L18','L19','L20','L21','L22','L23'];
father_vals = ['L1','L1','L4','L4','L4','L8','L8','L11','L11','L11','L15','L15','L15','L15','L15','L15','L15','L15'];
for (i=0; i<father_keys.length; i++) {
    father[father_keys[i]] = father_vals[i];
}

lwidth = new Array();
var lwidthDetected = 0;

function moveLayers()
{
    if (!lwidthDetected) {
        for (i=0; i<numl; i++) {
            lwidth[listl[i]] = getOffsetWidth(listl[i]);
        }
        lwidthDetected = 1;
    }
    if (IE4) {
        for (i=0; i<numl; i++) {
            setWidth(listl[i], abscissaStep);
        }
    }
    var hormenu1TOP = getOffsetTop('hormenu1L1');
    var hormenu1HEIGHT = getOffsetHeight('hormenu1L1');
    setTop('L1', hormenu1TOP + hormenu1HEIGHT);
    moveLayerX1('L1', 'hormenu1');
    setTop('L4', hormenu1TOP + hormenu1HEIGHT);
    moveLayerX1('L4', 'hormenu1');
    setTop('L8', hormenu1TOP + hormenu1HEIGHT);
    moveLayerX1('L8', 'hormenu1');
    setTop('L11', hormenu1TOP + hormenu1HEIGHT);
    moveLayerX1('L11', 'hormenu1');
    setTop('L15', hormenu1TOP + hormenu1HEIGHT);
    moveLayerX1('L15', 'hormenu1');

}

back = new Array();
for (i=1; i<=24; i++) {
    back['L' + i] = 0;
}

// -->
</script>

<!--ENDOFMENU-->
<link rel="stylesheet" href="/pub/css.css" type="text/css">
</head>
<body bgcolor="#686868" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="719px" border="0" cellspacing="0" cellpadding="0" class="outerpage" align="center">
    <tr> 
        <td height="9">
            <img src="/pub/img/key_image.png" width="719" height="59">
        </td>
    </tr>
    <tr> 
        <td height=25>
            <!-- beginning of horizontal menu bar -->

<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="horbar">
<table border="0" cellspacing="0" cellpadding="0">
<tr>

<td>

<div id="hormenu1L1" class="horbaritem" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<a href="java script:void(false);" onmouseover="moveLayerX1('L1', 'hormenu1'); LMPopUp('L1', false);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon_system.png" width="25" height="25" border="0"
alt="" /> Status <img
src="menuimages/down-arrow.png" width="9" height="5"
border="0" alt=">>" />   </a>
</div>
</td>
<td>

<div id="hormenu1L4" class="horbaritem" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<a href="java script:void(false);" onmouseover="moveLayerX1('L4', 'hormenu1'); LMPopUp('L4', false);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon_storage.png" width="25" height="25" border="0"
alt="" /> Storage <img
src="menuimages/down-arrow.png" width="9" height="5"
border="0" alt=">>" />   </a>
</div>
</td>
<td>

<div id="hormenu1L8" class="horbaritem" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<a href="java script:void(false);" onmouseover="moveLayerX1('L8', 'hormenu1'); LMPopUp('L8', false);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon_network.png" width="25" height="25" border="0"
alt="" /> Network <img
src="menuimages/down-arrow.png" width="9" height="5"
border="0" alt=">>" />   </a>
</div>
</td>
<td>

<div id="hormenu1L11" class="horbaritem" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<a href="java script:void(false);" onmouseover="moveLayerX1('L11', 'hormenu1'); LMPopUp('L11', false);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon_accounts.png" width="25" height="25" border="0"
alt="" /> Accounts <img
src="menuimages/down-arrow.png" width="9" height="5"
border="0" alt=">>" />   </a>
</div>
</td>
<td>

<div id="hormenu1L15" class="horbaritem" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<a href="java script:void(false);" onmouseover="moveLayerX1('L15', 'hormenu1'); LMPopUp('L15', false);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon_maintenance.png" width="25" height="25" border="0"
alt="" /> System <img
src="menuimages/down-arrow.png" width="9" height="5"
border="0" alt=">>" />   </a>
</div>
</td>
<td>

<div id="hormenu1L24" class="horbaritem" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<a href="/adm/getform.html?name=lang" onmouseover="shutdown();"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon_lang.png" width="25" height="25" border="0"
alt="" /> Language   </a>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>

        </td>
    </tr>
    <tr> 
        <td height="17">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr> 
            </table>
        </td>
    </tr>
    <tr> 
        <td height="2">
            <img src="/pub/img/s.png" width="719" height="15">
        </td>
    </tr>
    <tr>
        <td align="center">
            <table>
                <tr>
                    <td class="block_04">
                        <!---------HTML_CODE_ABOVE--------->
                        <span class="block_03">
<form name="sdrbform" method="post" action="setform.html" id="sdrbform">
<input type=hidden name="prefix" id="prefix" value="sdrb">
<input type=hidden name="action" id="action" value="">
<table>
<tr><td>
   <div class="step">
      <div class="step_title">Shutdown/Reboot System</div>
      <div class="step_desp"></div>
   </div>
</td></tr>
<tr><td class="block_button" style="padding:0">
<table border=0><tr><td><div class="button_copy" onclick="does('reboot')">Reboot</div></td>
<td><div class="button_copy" onclick="does('shutdown')">Shutdown</div></td></tr></table>
</td></tr>
</table>
</form>
</span>
<script language="javascript">
var form1=getForm('sdrbform');
function does(action){
    var sure = '';
    if(action == 'shutdown'){
        sure = "Are you sure to shutdown the system?";
    }
    else{
        sure = "Are you sure to reboot the system?";
    }
    if (confirm(sure)){
    form1.form.elements['action'].value=action;
    form1.form.submit();
    }
}
</script>
                        <!---------HTML_CODE_BELOW--------->
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr> 
        <td height="54"> 
            <div align="right">
                <img src="/pub/img/slo.png" width="491" height="54">
            </div>
        </td>
    </tr>
    <tr> 
        <td height="30"> 
            <table width="245" border="0" cellspacing="0" cellpadding="0" height="30" class="www">
                <tr> 
                    <td> </td>
                    <td>
                        <a href="http://www.thecus.com/" target="_blank">
                            <img src="/pub/img/www.png" width="165" height="30" border=0>
                        </a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<!-- beginning of menu footer - PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/ -->



<div id="L1" class="submenu" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap">
<div class="subframe">

<div id="refL1" class="item">
<a href="/adm/getform.html?name=system" onmouseover="LMPopUp('L1', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> System      </a>
</div>
<div id="refL2" class="item">
<a href="/adm/getform.html?name=allset" onmouseover="LMPopUp('L1', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Info    </a>
</div>
<div id="refL3" class="item">
<a href="/adm/getform.html?name=about" onmouseover="LMPopUp('L1', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> About   </a>
</div>

</div>
</td>
</tr>
</table>
</div>

<div id="L4" class="submenu" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap">
<div class="subframe">

<div id="refL5" class="item">
<a href="/adm/getform.html?name=disks" onmouseover="LMPopUp('L4', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Disks   </a>
</div>
<div id="refL6" class="item">
<a href="/adm/getform.html?name=raid" onmouseover="LMPopUp('L4', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> RAID    </a>
</div>
<div id="refL7" class="item">
<a href="/adm/getform.html?name=share" onmouseover="LMPopUp('L4', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Folder      </a>
</div>
<div id="refL8" class="item">
<a href="/adm/getform.html?name=nsync" onmouseover="LMPopUp('L4', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Nsync   </a>
</div>

</div>
</td>
</tr>
</table>
</div>

<div id="L8" class="submenu" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap">
<div class="subframe">

<div id="refL9" class="item">
<a href="/adm/getform.html?name=nic1" onmouseover="LMPopUp('L8', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> LAN 1   </a>
</div>
<div id="refL9" class="item">
<a href="/adm/getform.html?name=nic2" onmouseover="LMPopUp('L8', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> LAN 2   </a>
</div>
<div id="refL10" class="item">
<a href="/adm/getform.html?name=httpd" onmouseover="LMPopUp('L8', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Service     </a>
</div>
<div id="refL10" class="item">
<a href="/adm/getform.html?name=apple" onmouseover="LMPopUp('L8', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Apple Network   </a>
</div>
<div id="refL10" class="item">
<a href="/adm/getform.html?name=ftp" onmouseover="LMPopUp('L8', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> FTP     </a>
</div>
<div id="refL10" class="item">
<a href="/adm/getform.html?name=nsync_target" onmouseover="LMPopUp('L8', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Target      </a>
</div>

</div>
</td>
</tr>
</table>
</div>

<div id="L11" class="submenu" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap">
<div class="subframe">

<div id="refL12" class="item">
<a href="/adm/getform.html?name=winad" onmouseover="LMPopUp('L11', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Authentication      </a>
</div>
<div id="refL13" class="item">
<a href="/adm/getform.html?name=localuser" onmouseover="LMPopUp('L11', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Users   </a>
</div>
<div id="refL14" class="item">
<a href="/adm/getform.html?name=localgroup" onmouseover="LMPopUp('L11', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Groups      </a>
</div>

</div>
</td>
</tr>
</table>
</div>

<div id="L15" class="submenu" onmouseover="clearLMTO();" onmouseout="setLMTO();">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap">
<div class="subframe">

<div id="refL16" class="item">
<a href="/adm/getform.html?name=notif" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Notification    </a>
</div>
<div id="refL17" class="item">
<a href="/adm/getform.html?name=logal" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Logs    </a>
</div>
<div id="refL18" class="item">
<a href="/adm/getform.html?name=time" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Time    </a>
</div>
<div id="refL19" class="item">
<a href="/adm/getform.html?name=conf" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Config Mgmt     </a>
</div>
<div id="refL19" class="item">
<a href="/adm/getform.html?name=facdf" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Factory Default     </a>
</div>
<div id="refL20" class="item">
<a href="/adm/getform.html?name=updfw" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Firmware Upgrade    </a>
</div>
<div id="refL21" class="item">
<a href="/adm/getform.html?name=chpw" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Administrator Password      </a>
</div>
<div id="refL22" class="item">
<a href="/adm/getform.html?name=sdrb" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon.gif" width="25" height="25" border="0"
alt="" /> Reboot & Shutdown   </a>
</div>
<div id="refL23" class="item">
<a href="java script:if(confirm('Do you want to logout ?')) location.href='/adm/logout.html'" onmouseover="LMPopUp('L15', true);"><img
align="top" src="menuimages/transparent.png" width="1" height="16" border="0"
alt="" /><img
align="top" src="menuicons/menu_icon_logout.png" width="25" height="25" border="0"
alt="" /> Logout      </a>
</div>

</div>
</td>
</tr>
</table>
</div>

<script language="Javascript" type="text/javascript">
<!--
loaded = 1;
// -->
</script>

<!-- end of menu footer - PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/ -->
<script language="javascript">
  document.body.onunload=function (){
    //new Loading()
    status="loading"
  }
</script> 
</body>
</html>

Thanks

VW

Link to comment
Share on other sites

There are so many ways to accomplish things on a web page...

In this case, it appears that it is not an image or a button or a link, but rather a <DIV> element with an onclick action that does what you need here (although I see an image with a link lower in the page... you'll need to verify which one is performing the action for you).

If it is the DIV, you'll need to get a reference to it and then click it... something like:

$oDivs = _IETagNameGetCollection($oIE, "div")
For $oDiv in $oDivs
    If $oDiv.innerText = "Shutdown" Then
        _IEAction($oDiv, "click")
        ExitLoop
    EndIf
Next

Dale

Edit: Typo

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

There are so many ways to accomplish things on a web page...

In this case, it appears that it is not an image or a button or a link, but rather a <DIV> element with an onclick action that does what you need here (although I see an image with a link lower in the page... you'll need to verify which one is performing the action for you).

If it is the DIV, you'll need to get a reference to it and then click it...

Hi Dale,

Thanks for having a look at this. Unfortunately the snippet you posted didn't hit the button / <DIV> element.

I inserted a msgbox in the loop so that I could see what Tags were collected and observe the following responses:

Status Storage Network Accounts System Language (which are the main menu options)
Status
Storage
Network
Accounts
System
Language
Shutdown / Reboot System (the heading of the menu I am trying work with - rather than the buttons)
0 ( ? )

The trouble is I don't really understand how the collection parameters decides what tags to collect, are their other qualifiers I can use (i.e other than "innertext") that I can use to try and select the 'onclick' items?

Also are there any documents you can recommend that would be useful background reading, I'd like to better understand the "objects" (if that is the right description) that are available like "innertext" so that I can try and make an educated guess at what I should be trying. Really I have just been guessing with this page.

Thanks

VW

Link to comment
Share on other sites

See if this works.

$oForm = _IEFormGetObjByName($oIE, "sdrbform")
$oInput = _IEFormElementGetObjByName($oForm, "action")
_IEFormElementSetValue($oInput, "shutdown")
_IEFormSubmit($oForm)
If Bob's suggestion doesn't get you going you'lll need to help us better understand what EXACTLY you are trying to activate on this page. I cannot render it properly by saving the HTML because there are too many things missing. Try using MODIV2 (Google for it) to get info on the element or give us a screen shot.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

See if this works.

$oForm = _IEFormGetObjByName($oIE, "sdrbform")
$oInput = _IEFormElementGetObjByName($oForm, "action")
_IEFormElementSetValue($oInput, "shutdown")
_IEFormSubmit($oForm)
That works, thanks a bunch.

I'll have to study that and understand what it is doing.

VW

Link to comment
Share on other sites

  • Moderators

If you look at the source the onclick event for the div you want to click is "does('shutdown')".

<div class="button_copy" onclick="does('shutdown')">Shutdown</div>

All the "does" function really does is set the value of the hidden input named "action" and then submits the form.

function does(action){
    var sure = '';
    if(action == 'shutdown'){
        sure = "Are you sure to shutdown the system?";
    }
    else{
        sure = "Are you sure to reboot the system?";
    }
    if (confirm(sure)){
    form1.form.elements['action'].value=action;
    form1.form.submit();
    }
}

<input type=hidden name="action" id="action" value="">

We just bypass this function and do it our selves.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...