You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jelmer Kuperus (JIRA)" <ji...@apache.org> on 2008/04/25 16:33:05 UTC

[jira] Created: (WW-2617) Disabled attribute on checkbox should also disable the automatically created hidden formfield

Disabled attribute on checkbox should also disable the automatically created hidden formfield
---------------------------------------------------------------------------------------------

                 Key: WW-2617
                 URL: https://issues.apache.org/struts/browse/WW-2617
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.11.1
            Reporter: Jelmer Kuperus


Disabling a html form element  will cause its value not to be posted. 

when you disable a checkbox using  <s:checkbox name="somename" disable="true"/>

the value is still submitted because the hidden formfield that is created is not disabled.

The quick fix would be to change

<input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}" />

in checkbox.ftl to:

<input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}" 
<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>
</#if>
/>



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2617) Disabled attribute on checkbox should also disable the automatically created hidden formfield

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43988#action_43988 ] 

James Holmes commented on WW-2617:
----------------------------------

Actually, Don Brown fixed that in revision 649823.

> Disabled attribute on checkbox should also disable the automatically created hidden formfield
> ---------------------------------------------------------------------------------------------
>
>                 Key: WW-2617
>                 URL: https://issues.apache.org/struts/browse/WW-2617
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.11.1
>            Reporter: Jelmer Kuperus
>
> Disabling a html form element  will cause its value not to be posted. 
> when you disable a checkbox using  <s:checkbox name="somename" disable="true"/>
> the value is still submitted because the hidden formfield that is created is not disabled.
> The quick fix would be to change
> <input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}" />
> in checkbox.ftl to:
> <input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}" 
> <#if parameters.disabled?default(false)>
>  disabled="disabled"<#rt/>
> </#if>
> />

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2617) Disabled attribute on checkbox should also disable the automatically created hidden formfield

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-2617.
---------------------------------

    Resolution: Duplicate

Fixed by James Holmes on rv660539, although the comments refers to WW-2566

> Disabled attribute on checkbox should also disable the automatically created hidden formfield
> ---------------------------------------------------------------------------------------------
>
>                 Key: WW-2617
>                 URL: https://issues.apache.org/struts/browse/WW-2617
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.11.1
>            Reporter: Jelmer Kuperus
>
> Disabling a html form element  will cause its value not to be posted. 
> when you disable a checkbox using  <s:checkbox name="somename" disable="true"/>
> the value is still submitted because the hidden formfield that is created is not disabled.
> The quick fix would be to change
> <input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}" />
> in checkbox.ftl to:
> <input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}" 
> <#if parameters.disabled?default(false)>
>  disabled="disabled"<#rt/>
> </#if>
> />

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.