Submitting form using <html:submit> and <html:button>
Catherine <[email protected]>
| Newsgroups | gmane.comp.java.struts-menu.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I defined a variable in my ActionForm as "submitAction". And I have serveral buttons in my form as below.
<html:submit property="submitAction" value="Save">
This works and I get submitAction="Save".
----------------------------------------------------------------
<html:button property="submitAction" value="Delete" onclick="javascript:show('myAction.do?submitAction=Delete¶m1=someValue')">
function show(url) {
window.location.href = url
}
This also works since I append submitAction=Delete in the url. If I omit that then I get submitAction="". It seems that when using JavaScript to submit the form, the property of that button doesn't send as a request parameter. Can someone confirm if that is the case?
-------------------------------------------------------------
<html:select property="newProperty">
<html:options ......>
</html:select>
<html:button property="submitAction" value="Add Property" onclick="javascript:checkProp()">
I want to alert user if the new property already added, and stop then; or call my action if it is new property.
function checkProps() {
//check redundancy
if (redundant) {
alert(...);
return;
}
myform.submitAction="Add Property"; **
myform.submit();
}
I got submitAction="" even with line **. Any thoughts?
Thanks in advance!
-------------------------------------------------------------------
<a href="http://Struts_Menu_Users_List.roomity.com">roomity.com</a>
roomity.com is broadband internet. ~~1127425336629~~
-------------------------------------------------------------------