How to click on an "unnamed" image?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to click on an "unnamed" image?

José Román | Idiria S.L.

I am new to HTMLUnit (read about it but just starting with a hands-on). I have a web page with a form whose "next" button is a simple input image without name nor id:

<input src="https://static.XXX.com/imagenes/siguiente.gif" alt="SIGUIENTE" type="image">

The form head is as follows:

<form action="/lugar/" method="PUT" onsubmit="return validaFormulario()" id="frmStep2" name="frmStep2">

And the validation JavaScript is:

var _localidadObligatoria = true;
var _skipValidation = false;

function validaFormulario() {
  if (_skipValidation == true)
    return true;
  if ((document.getElementById('p').value == "df") || (_localidadObligatoria && document.getElementById("l").value == '')) {
    alert('Rellene los campos necesarios marcados con asterisco.');
    return false;
  }

  return true;
}

I have tried different proposals as this one which showed promising:

HtmlUnit, how to post form without clicking submit button?

But when I click on the newly created fake button I only go back to the same page.

Can someone me explain the login behind correctly submitting this form based on HTMLUnit/HTM/Javascript perspective?

Thanks in advance,

Jose



--


José Román Bilbao Castro

Ingeniero Consultor
+34 901009188
[hidden email]
http://idiria.com <http://idiria.com/>

--
Idiria Sociedad Limitada - Aviso legal

Este mensaje, su contenido y cualquier fichero transmitido con él está dirigido únicamente a su destinatario y es confidencial. Por ello, se informa a quien lo reciba por error ó tenga conocimiento del mismo sin ser su destinatario, que la información contenida en él es reservada y su uso no autorizado, por lo que en tal caso le rogamos nos lo comunique por la misma  vía o por teléfono (+ 34 690207492), así como que se abstenga de reproducir el mensaje mediante cualquier medio o remitirlo o entregarlo a otra persona, procediendo a su borrado de manera inmediata. 
 
Idiria Sociedad Limitada se reserva las acciones legales que le correspondan contra todo tercero que acceda de forma  ilegítima al contenido de cualquier mensaje externo procedente del mismo. 

Para información y consultas visite nuestra web http://www.idiria.com 

 

Idiria Sociedad Limitada - Disclaimer
This message, its content and any file attached thereto is for the intended recipient only and is confidential. If you have received this e-mail in error or had access to it, you should note that the information in it is private and any use thereof is unauthorised. In such an event please notify us by e-mail or by telephone (+ 34 690207492). Any reproduction of this e-mail by whatsoever means and any transmission or dissemination thereof to other persons is prohibited. It should be deleted immediately from your system.

Idiria Sociedad Limitada reserves the right to take legal action against any persons unlawfully gaining access to the content of any external message it has emitted.

For additional information, please visit our website 
http://www.idiria.com 

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user