Hello, i don't know how to press the button with innertext "Selecionar archivo" (in red color) it is a button to open a new window to select a file from computer to upload
This form it is into a iframe:
i have a code that go to the web, login with username and password, go to the page for load data (the code above it is embebed into a iframe)
I can click the button with tag "button" with this code:
But the other button don't have property "*******" instead when i pressed with the mouse one window of the OS (not for navigate) open to get the file in my computer
And this is the code javascript into the form:
ie.Navigate ("javascript:envioFichero();") code don't work because the javascript code it is into a iframe and i try with
Set iDoc = ie.Document.frames("curro").Document
ie.iDoc.Navigate ("javascript:envioFichero();") and don' work
This form it is into a iframe:
HTML:
<form name="ficheroForm" method="POST" action="/house/loadfile.do" enctype="multipart/form-data">
//............more code........
<div class="uploader">
<input type="file" name="fichero" size="80%" value="" class="form1" style="opacity: 0; ">
<span class="filename">Seleccionar archivo</span>
[B][COLOR="Red"]<span class="action">Examinar</span>[/COLOR][/B]
</div>
//.....more code.....
<label><div class="checker"><span>
<input type="checkbox" name="confirmacion" value="true" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; opacity: 0; ">
</span></div> Recibir confirmación vía correo electrónico</label>
<div class="button">
<span>Cargar fichero<button *******="aceptar();return false;" style="opacity: 0; ">Cargar fichero</button>
</span></div>
i have a code that go to the web, login with username and password, go to the page for load data (the code above it is embebed into a iframe)
I can click the button with tag "button" with this code:
But the other button don't have property "*******" instead when i pressed with the mouse one window of the OS (not for navigate) open to get the file in my computer
Code:
Set iDoc = ie.Document.frames("curro").Document
Dim boton As Object
For Each boton In iDoc.getElementsByTagName("button")
boton.Click
Next
And this is the code javascript into the form:
Code:
******** language="JavaScript">
function aceptar(){
var form = document.forms[0];
if (form.fichero.value == "") {
mensaje = 'Debe introducir un fichero';
alert(mensaje);
form.fichero.focus();
return false;
} else {
form.action="cargaFichero.do";
form.submit();
cargandoImg();
}
}
function envioFichero(){
var form = document.forms[0];
form.action="cargaFichero.do";
form.submit();
cargando();
}
function setFileNameFromPath(path){
document.forms[0].elements['filename'].value = value = path.substr(path.lastIndexOf('\\') + 1);
//var oas = new ActiveXObject("Scripting.FileSystemObject");
//var d = document.a.b.value;
//var e = oas.getFile(d);
//var f = e.size;
//alert(f + " bytes");
}
*********>
ie.Navigate ("javascript:envioFichero();") code don't work because the javascript code it is into a iframe and i try with
Set iDoc = ie.Document.frames("curro").Document
ie.iDoc.Navigate ("javascript:envioFichero();") and don' work