You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Roger Varley <ro...@googlemail.com> on 2007/04/27 14:55:12 UTC

[S2] Problem with Form Tag

Hi

I've got this snippet in my .jsp file

<s:iterator value="order.details" status="status">
                <s:set name="indexValue" value="#status.index"/>

                <s:form id="form%{#indexValue}" method="post"
action="setLineItemAction" disabled="true">

                    <s:textfield
name="order.details[%{#status.index}].productCode"/>
                    <s:textfield
name="order.details[%{#status.index}].productDescription"/>
                    <s:textfield
name="order.details[%{#status.index}].quantity"/>
                <s:submit/>
                </s:form>
                </s:iterator>

but the disabled attribute is not being rendered into the final html,
so all the forms are active. What am I doing wrong?

Regards
Roger

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


Re: [S2] Problem with Form Tag

Posted by Roger Varley <ro...@googlemail.com>.
> Did you tried set readOnly?
> Are you using ajax theme? If yes, maybe this is the problem. Try the others
> theme. In the most of cases, this won't affect the ajax behavior of
> application, once submit has its theme setted to ajax.
>

I'm using the simple theme. I've now also found that specifying the
onclick attribute on the <s:form> tag doesn't map through to the
generated HTML either.

Regards
Rogetr

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


Re: [S2] Problem with Form Tag

Posted by Felipe Rodrigues <fe...@yahoo.com.br>.
Did you tried set readOnly? 
Are you using ajax theme? If yes, maybe this is the problem. Try the others
theme. In the most of cases, this won't affect the ajax behavior of
application, once submit has its theme setted to ajax.

Regards,

Felipe


Roger Varley wrote:
> 
> On 27/04/07, Felipe Rodrigues <fe...@yahoo.com.br> wrote:
>>
>> Put disabled in the fields instead of in the form.
>>
> 
> That's no good for me. If you click on a field within a disabled form,
> the onclick() event is triggered, but if you leave the form active and
> disable each field individually the onclick() event does not fire. I
> need to responsd to the onclick() event to make that form the "active
> form" for the page.
> 
> I can work around it by calling document.forms[].disabled="true" for
> each form on the page in a script called from the body onload() event
> but I was wondering why the s:form tag doesn't appear to support the
> disabled attribute.
> 
> Regards
> Roger
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Problem-with-Form-Tag-tf3657504.html#a10221951
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Problem with Form Tag

Posted by Roger Varley <ro...@googlemail.com>.
On 27/04/07, Felipe Rodrigues <fe...@yahoo.com.br> wrote:
>
> Put disabled in the fields instead of in the form.
>

That's no good for me. If you click on a field within a disabled form,
the onclick() event is triggered, but if you leave the form active and
disable each field individually the onclick() event does not fire. I
need to responsd to the onclick() event to make that form the "active
form" for the page.

I can work around it by calling document.forms[].disabled="true" for
each form on the page in a script called from the body onload() event
but I was wondering why the s:form tag doesn't appear to support the
disabled attribute.

Regards
Roger

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


Re: [S2] Problem with Form Tag

Posted by Felipe Rodrigues <fe...@yahoo.com.br>.
Put disabled in the fields instead of in the form.

regards,

Felipe


Roger Varley wrote:
> 
> Hi
> 
> I've got this snippet in my .jsp file
> 
> <s:iterator value="order.details" status="status">
>                 <s:set name="indexValue" value="#status.index"/>
> 
>                 <s:form id="form%{#indexValue}" method="post"
> action="setLineItemAction" disabled="true">
> 
>                     <s:textfield
> name="order.details[%{#status.index}].productCode"/>
>                     <s:textfield
> name="order.details[%{#status.index}].productDescription"/>
>                     <s:textfield
> name="order.details[%{#status.index}].quantity"/>
>                 <s:submit/>
>                 </s:form>
>                 </s:iterator>
> 
> but the disabled attribute is not being rendered into the final html,
> so all the forms are active. What am I doing wrong?
> 
> Regards
> Roger
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Problem-with-Form-Tag-tf3657504.html#a10219394
Sent from the Struts - User mailing list archive at Nabble.com.


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