You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Au-Yeung, Stella H" <st...@eds.com> on 2004/02/23 22:33:08 UTC

Must have action="....." in tag?

Hi:
My <html:form> tag doesn't allow me to skip an 'action' attribue.   If you
look at my code below, I move the assignment of the 'form action'  to the
javascript function so which action to take is dynamically depends on the
form element 'whichAction'.  But the compiler insist I have to have the
'action' property right inside the <html:form> tag.  But that doesn't allow
me to choose the action dynamically.   Does anyone have any suggestion?

<script language = "Javascript">
function submitForm(frm)
{
   var whichAction=frm.elements("whichAction")

   if (whichAction == "create")
   {
      document.theForm.action =
"/app/fdd/shopWorkOrder/fromCreateShopWorkOrder;
   }
   else
   {
      document.theForm.action =
"/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder;
   }

   return true;
}
</script>


<jsp:useBean id="ShopWorkOrderBean" scope="request"
 
class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/>
<html:form name="theForm" method="post" onSubmit="return
submitForm(document.theForm)">


I got the following error with the above code:
Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: 
/app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action'
not specified for tag 'form'
probably occurred due to an error in
/app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28:
<html:form name="theForm" method="post" onSubmit="return
submitForm(document.theForm)">




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


Re: Must have action="....." in tag?

Posted by Hubert Rabago <ja...@yahoo.com>.
Specify the Action associated with "fromCreateShopWorkOrder" or
"fromUpdateShopWorkOrder" in the <html:form> attribute.

--- "Au-Yeung, Stella H" <st...@eds.com> wrote:
> Hi:
> My <html:form> tag doesn't allow me to skip an 'action' attribue.   If you
> look at my code below, I move the assignment of the 'form action'  to the
> javascript function so which action to take is dynamically depends on the
> form element 'whichAction'.  But the compiler insist I have to have the
> 'action' property right inside the <html:form> tag.  But that doesn't allow
> me to choose the action dynamically.   Does anyone have any suggestion?
> 
> <script language = "Javascript">
> function submitForm(frm)
> {
>    var whichAction=frm.elements("whichAction")
> 
>    if (whichAction == "create")
>    {
>       document.theForm.action =
> "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder;
>    }
>    else
>    {
>       document.theForm.action =
> "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder;
>    }
> 
>    return true;
> }
> </script>
> 
> 
> <jsp:useBean id="ShopWorkOrderBean" scope="request"
>  
> class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/>
> <html:form name="theForm" method="post" onSubmit="return
> submitForm(document.theForm)">
> 
> 
> I got the following error with the above code:
> Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: 
> /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action'
> not specified for tag 'form'
> probably occurred due to an error in
> /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28:
> <html:form name="theForm" method="post" onSubmit="return
> submitForm(document.theForm)">
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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