You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alberto de la Cruz <ac...@borneo-software.com> on 2003/05/06 00:04:30 UTC

Form submit doesn't work

I am trying to submit a form using javascript.

My Code:
....
                <td><html:submit value="Create" property="submit" 
styleId="buttonCreate" disabled="true" onClick="doSubmit()"/></td>
                <td><html:submit value="Modify" property="submit" 
styleId="buttonModify" disabled="true" onClick="doSubmit()"/></td>
                <td><html:submit value="Delete" property="submit" 
styleId="buttonDelete" disabled="true" onClick="confirmDelete()"/></td>
                <td><html:reset styleId="buttonReset"/></td>
...
<script language="JavaScript">
function confirmDelete() {
    var ok = confirm("Are you sure?");
    if (ok) {
        doSubmit();
    }
}

function doSubmit() {
    document.forms[0].alias.disabled = false;
    document.forms[0].submit();
}

</script>

It doesn't work.
Can someone tell me what is going on please?.

Note: The <html:form> tag has not a onSubmit() parameter. It works with 
it, but the form is always submitted (even if I choose NO in the confirm 
message).

Thanks in advance.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org