سؤال

I've got an s:form with sj:submit and s:submit inside, sj:submit works properly but s:submit buttons doesn't works. Nothing happens when I click on s:submit buttons.

I tried to use sj:submit button outside the form and linking that to s:form with formIds parameter.

هل كانت مفيدة؟

المحلول 2

I solved using:

<s:submit onClick="overrideSubmit('this_action')"/>

and

function overrideSubmit(actionName) {
        document.forms['configurationForm'].action = actionName + '.action';
        document.forms['configurationForm'].submit();
    }

نصائح أخرى

Problem here is the e.PreventDefault() to prevent a normal submit on press enter inside of an form textfield.

See: http://code.google.com/p/struts2-jquery/source/browse/trunk/struts2-jquery-plugin/src/main/resources/template/js/struts2/jquery.struts2.js#947

What about using an normal Link instead of an button?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top