File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How could I disable onclick action of html:image ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How could I disable onclick action of html:image ?" Watch "How could I disable onclick action of html:image ?" New topic
Author

How could I disable onclick action of html:image ?

Alejandro Guzman
Greenhorn

Joined: Jan 12, 2005
Posts: 2
I am using an <html:image> tag for login submit action. I'm calling j_security_check servlet to validate user and password. The problem is if I click the image and press "enter" almost at the same time Tomcat throw me a exeception. So, what I want is disable the onclick event is actived.... Or is there any other way to solve this problem ???

html:image property="btnAceptar" on-click="return btnLogon()" border="0" bundle="Images" srcKey="imagen.boton.aceptar.src"

funtion btnLogon()
{
var usuario = document.getElementById("j_username");
var clave = document.getElementById("j_password");
if( ( trim(usuario.value) !== "") && ( trim(clave.value) !== "") )
{
document.inicioSesionFormBean.action = "/clinycas/logon";
document.inicioSesionFormBean.submit();
return true;
}
else ( trim(usuario.value) == "" )
{
alert("");
usuario.focus();
return false;
}

Thanks in advance,

Alejandro.-
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How could I disable onclick action of html:image ?