0

我有一个需要 EmpID 和两个密码才能登录的工作计算机服务器。我可以保存登录屏幕的源代码,然后使用我的信息对每个字段的 value= 进行硬编码。(EmpID、Password1、Password2)。打开这个文件并按下登录按钮可以使用我在 value= 中的信息。我只是想流线,所以我不必按下登录按钮,然后我可以在我用 Android App Inventor 创建的应用程序中使用这个文件。

我希望在我打开文件时提交。我不想按登录按钮。有没有办法改变

input type="submit" name="ctl01$mHolder$CmdLogin" value="      Login     " onclick= 

在打开文件而不是点击时提交的东西?有什么建议么?

谢谢!!!

这是来自我的工作服务器的 HTML 源代码。我更改了服务器的地址以及我的 EmpID 和密码...

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
</head>
<body>
<form name="aspnetForm" method="post" action="https://my.work.com/Default.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm"> 
<div> 
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" /> 
<input type="hidden" name="__EVENTTARGET".__EVENTTARGET.value = eventTarget;         theForm.__EVENTARGUMENT.value = eventArgument; 
<div class="loginOuterStyle"> 
<div class="ie5borderfix">
<div class="formHeader">&nbsp;</div>
<div class="formContent"> 
<div class="contentHeader">&nbsp;</div>
<div class="contentArea"> 
<div class="validateErrorSummary">
<div id="ctl01_mHolder_validateErrorSummary" style="color:Red;display:none;">
</div> 
<form>
<table id="ctl01_mHolder_LoginTable" class="formTable"> 
<tr class="formHeader"> 
<td class="formCell"> 
<div class="empID">
<label>Login ID:</label>                 
<div class="inputItem">
<input name="ctl01$mHolder$txtUserID" type="text" maxlength="5" id="ctl01_mHolder_txtUserID" VALUE="MyEmpID" class="inputField" size="15" /> 
<span id="ctl01_mHolder_txtUserIDRfValidator" style="color:Red;display:none;"></span>
<span id="ctl01_mHolder_txtUserIDReValidator" style="color:Red;display:none;"></span>
</div>
</div>             
<div class="coPassword">                 
<label>CO Password:</label>                    
<div class="inputItem">                     
<input name="ctl01$mHolder$txtUserESCPassword" type="password" maxlength="50" id="ctl01_mHolder_txtUserESCPassword" VALUE="111111" class="inputField" size="15" />
<span id="ctl01_mHolder_txtUserESCPasswordRfValidator" style="color:Red;display:none;"></span>                     
<span id="ctl01_mHolder_txtUserESCPasswordReValidator" style="color:Red;display:none;"></span>                 
</div>
</div>             
<div class="ccsPassword">                 
<label>CCS Password:</label>                    
<div class="inputItem">                     
<input name="ctl01$mHolder$txtUserPassword" type="password" maxlength="8" id="ctl01_mHolder_txtUserPassword" VALUE="222222" class="inputField" size="15" /> 
<span id="ctl01_mHolder_txtUserPasswordRfValidator" style="color:Red;display:none;"></span>  
<span id="ctl01_mHolder_txtUserPasswordReValidator" style="color:Red;display:none;"></span>
</div>
</div> 
<div class="contentSubmit">
<input type="submit" name="ctl01$mHolder$CmdLogin" value="      Login     " onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl01$mHolder$CmdLogin&quot;, &quot;&quot;, true, &quot;LoginGroup&quot;, &quot;&quot;, false, false))" id="ctl01_mHolder_CmdLogin" />
</div>
<div class=WordSection1></form></div>
</body>
</html> 
4

1 回答 1

1

使用 jQuery on change 方法:

$('input[name=ctl01$mHolder$CmdLogin]').on("change", function(){ domysubmit(); });

甚至是原生 Javascript onchange 方法,只需稍加调整。

<input type='file' onchange='submitFile(this)'/>

function submitFile(el){
   var fn = $(el).val();//get file path
   domysubmit();
}
于 2013-07-15T23:53:54.467 回答