salvatore imparato
asked on
intercept the commAnd clcik
Hi have this code and the html page, i cannot intercept the command to confirm da value inserted in login with click:
Sub PROVA()
' Prepare to open the web page
Set ie = CreateObject("InternetExpl orer.Appli cation")
With ie
.Visible = True
.Navigate "http://crediti/cr/html/logon/logonAutenticazione.html"
'.Navigate "http://crediti/cr/html/menu/"
' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop
' Make the desired selections on the web page and click the submit Button
' IE ie.document.all.Item LEGGE NELLA PAGINA html il tag di riferimento
Set ipf = ie.document.all.Item("USER -ID_0")
ipf.Value = Range("a1") '.Value
Set ipf = ie.document.all.Item("PASS WORD_0")
ipf.Value = Range("b1") '.Value
'Set ipf = ie.document.all.Item("CHOI CE")
'ipf.Value = Range("c1") '.Value
?????????????????????????? ?????
ipf.Click
?????????????????????????? ????
' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop
End With
========================== ========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!-- Versione: 3.1.3.2004-09-27.0.BNL -->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Style- Type" content="text/css">
<META name="GENERATOR" content="IBM WebSphere Page Designer V3.0.2 for Windows">
<LINK href="/cr/theme/concentrat ore.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY>
<script language="JavaScript1.2">
parent.autenticazione = null;
function controllaCredenziali() {
var userID = document.FormDati.elements ["USER-ID_ 0"].value. replace(/ /gi, "");
var password = document.FormDati.elements ["PASSWORD _0"].value .replace(/ /gi, "");
var risultato = true;
if ((userID == "") || (password == "")) {
risultato = false;
}
return risultato;
}
function connect() {
if (controllaCredenziali()) {
document.forms[0].elements ["SYS-ID-U TENTE_0"]. value = document.forms[0].elements ["USER-ID_ 0"].value;
document.forms[0].submit() ;
} else {
alert ("Non hai inserito User ID o Password!");
}
}
function onClickApriCambioPassword( ) {
parent.FrameDati.location = '/cr/html/logon/logonCambi oPassword. html';
parent.FrameErrori.locatio n = '/cr/html/blank.html';
}
</script>
<h1>BNL Loan Services</h1>
<form name="FormDati" method="POST" action="/cr/ServletControl lerAutenti cazione">
<!-- Servlet Controller Autenticazione -->
<input type="hidden" name="IS-CAMBIO-PASSWORD-R ICHIESTO" value="N">
<!-- Area Tecnica RB -->
<INPUT type="hidden" name="SYS-ID-UTENTE_0" value="">
<INPUT type="hidden" name="SYS-ID-LINGUA_0" value="ITA">
<INPUT type="hidden" name="SYS-CANALE-LOGICO_0" value="">
<!-- Area Applicativa Autenticazione - Da Personalizzare (CBS) -->
<input type="hidden" name="NOME-SISTEMA_0" value="">
<!-- Inizializzazione dati per scelta banca -->
<input type="hidden" name="CD-CXS_0" value="">
<input type="hidden" name="CODICE-BANCA_0" value="">
<table>
<tr>
<td class='EtichettaDescrizion e'>User ID</td>
<td><input type="text" class="InputText" size="10" name="USER-ID_0" maxlength="8"></td>
</tr>
<tr>
<td class='EtichettaDescrizion e'>Passwor d</td>
<td class='CampoVisibile'><inp ut type="password" class="InputPassword" size="10" name="PASSWORD_0" maxlength="8"></td>
</tr>
<tr>
<td><A class='Button' HREF='javascript:void(0);' onClick='connect();return false;'>CONNETTI</A></td>
<td><A class='Button' HREF='javascript:void(0);' onClick='onClickApriCambio Password() ;return false;'>CAMBIA PASSWORD</A></td>
</tr>
</table>
</form>
</BODY>
</HTML>
Sub PROVA()
' Prepare to open the web page
Set ie = CreateObject("InternetExpl
With ie
.Visible = True
.Navigate "http://crediti/cr/html/logon/logonAutenticazione.html"
'.Navigate "http://crediti/cr/html/menu/"
' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop
' Make the desired selections on the web page and click the submit Button
' IE ie.document.all.Item LEGGE NELLA PAGINA html il tag di riferimento
Set ipf = ie.document.all.Item("USER
ipf.Value = Range("a1") '.Value
Set ipf = ie.document.all.Item("PASS
ipf.Value = Range("b1") '.Value
'Set ipf = ie.document.all.Item("CHOI
'ipf.Value = Range("c1") '.Value
??????????????????????????
ipf.Click
??????????????????????????
' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop
End With
==========================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!-- Versione: 3.1.3.2004-09-27.0.BNL -->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Style-
<META name="GENERATOR" content="IBM WebSphere Page Designer V3.0.2 for Windows">
<LINK href="/cr/theme/concentrat
</HEAD>
<BODY>
<script language="JavaScript1.2">
parent.autenticazione = null;
function controllaCredenziali() {
var userID = document.FormDati.elements
var password = document.FormDati.elements
var risultato = true;
if ((userID == "") || (password == "")) {
risultato = false;
}
return risultato;
}
function connect() {
if (controllaCredenziali()) {
document.forms[0].elements
document.forms[0].submit()
} else {
alert ("Non hai inserito User ID o Password!");
}
}
function onClickApriCambioPassword(
parent.FrameDati.location = '/cr/html/logon/logonCambi
parent.FrameErrori.locatio
}
</script>
<h1>BNL Loan Services</h1>
<form name="FormDati" method="POST" action="/cr/ServletControl
<!-- Servlet Controller Autenticazione -->
<input type="hidden" name="IS-CAMBIO-PASSWORD-R
<!-- Area Tecnica RB -->
<INPUT type="hidden" name="SYS-ID-UTENTE_0" value="">
<INPUT type="hidden" name="SYS-ID-LINGUA_0" value="ITA">
<INPUT type="hidden" name="SYS-CANALE-LOGICO_0"
<!-- Area Applicativa Autenticazione - Da Personalizzare (CBS) -->
<input type="hidden" name="NOME-SISTEMA_0" value="">
<!-- Inizializzazione dati per scelta banca -->
<input type="hidden" name="CD-CXS_0" value="">
<input type="hidden" name="CODICE-BANCA_0" value="">
<table>
<tr>
<td class='EtichettaDescrizion
<td><input type="text" class="InputText" size="10" name="USER-ID_0" maxlength="8"></td>
</tr>
<tr>
<td class='EtichettaDescrizion
<td class='CampoVisibile'><inp
</tr>
<tr>
<td><A class='Button' HREF='javascript:void(0);'
<td><A class='Button' HREF='javascript:void(0);'
</tr>
</table>
</form>
</BODY>
</HTML>
ASKER
Error run time 424....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
WORK!!!!!!!!!
IE.Document.forms(0).submi t
... but have experince and "time" on web and VBA?
IE.Document.forms(0).submi
... but have experince and "time" on web and VBA?
sal21,
Glad it worked. The reason it works is because the button itself doesn't have a click method, just a click event which normally submits the form. All the line of code does that works is to submit that form directly.
Tim
Glad it worked. The reason it works is because the button itself doesn't have a click method, just a click event which normally submits the form. All the line of code does that works is to submit that form directly.
Tim
ie.document.forms[0].submi
Tim Cottee