Catherine wrote:
Hi,
I am posting from roomity. Somehow my origainal post was truncated. Here is my
question.
I have several buttons in my form.
1. <html:submit property="submitAction" value="Save">
This is fine, I get submitAction="Save" when action is invoked.
2. <html:button property="submitAction" value="Delete"
onclick="javascript:show('myAction.do?submitAction=Delete&.....')">
Function show(url) is defined as in my first post. I found that the property is not
submitted, so I have to append "submitAction=Delete" after the action. So if I
use javascript, what does the property field give me?
3. <html:button property="submitAction" value="Add Property"
onclick="javascript:checkProp()">
This is my real problem. I have a single selection dropdown menu which contains the allowed
properties of the object. When user selects a property and clicks the Add Property button, I call
checkProp() to check if it already added to the object. If yes, I alert user and don't submit form;
if no, I call form.submit(). I found that submitAction="" if the form is submitted this
way. I tried to do form.submitAction.value = "Add Property" before submit(), but that
didn't help. How can I pass that value?
If you define an onclick event handler then, as far as I understand it,
clicking the button will execute the event handler first and then submit
the form second *if* the event handler returns true. So, if your
checkProp() function returns true the form would be submitted as if you
hadn't had an onclick handler; if it returns false, the form will not be
submitted.
For case 2, you're specifying the URL to load in the Javascript so
you're not submitting the form. Therefore your form properties aren't
included in the request. I'm not sure how you get the onclick handler to
submit the form as if the handler weren't there, my Javascript fu isn't
that good yet ;-)
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]