how's things,
I'm having trouble with a
jsp where I want to determine which button was selected on a logout confirmation form I have, at the moment I'm trying to do this by using a javascript function to determine a
string value " onClick ", and the pass this value to the corresponding actionform(i'm using jsp's with
struts,
tomcat,
java) as a hidden field, but the value been passed is null, I've tried to get this working for a couple of days now, I�m sure its something small, I just can't see it so any help would be appreciated, nice one, here's the jsp:
<title>Logout Confirmation</title>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<head>
<script type="text/javascript">
function set(target)
{
document.forms.dispatchForm.dispatch.value=target;
<!--document.forms.DispatchForm.submit();-->
}
</script>
</head>
<body>
<html:form styleId="dispatchForm" action="/confirmLogout">
<input name="dispatch" type="hidden" property="dispatch" value="ok"/>
<!--<html:hidden name="dispatch" property="dispatch" value="target"/>-->
<!--<input type="hidden" name="dispatch" value="target">-->
<table class="tborder" width="50%" cellspacing="1" cellpadding="3" align="center">
<tr>
<td colspan="2"> Are you sure you would like to logout?</td>
</tr>
<tr>
<td>
<html:submit property="action" value="OK" onClickage="set('ok');" />
</td>
<td>
<html:submit property="action" value="Cancel" onClickage="set('cancel');" />
</td>
</tr>
</table>
<br/>
</html:form>
</body>
wasn't allowed to post topic without changing to onClickage,