Results 1 to 4 of 4

Thread: <form:input disabled="true"> is blocking the data in the request object

  1. #1

    Default <form:input disabled="true"> is blocking the data in the request object

    Hi,

    While using form:input & trying to disable it either by disabled attribute or by js function onchange, it seems to block the data from being sent to the server.

    This is the code:
    Code:
    <form:input							
                 id="input_value_integer" 						
                 title="From line ${increment}" 					
                 privilegeId="<%= Constants.PRIVELEGE.ADM_MANAGE_PRICING %>"	
                 path="defPPLst[${dPPSts.index}].fromBulkLevel"
    	cssClass="forminput" 
    	cssStyle="align:left; "
    	onkeypress="return noEnter(event);"
    	onchange="checkInput(this)"
    	onselect="initInput(this)" 						
                 onfocus="initInput(this)"						
             onmousedown="disableField(this);"		
    />
    Code:
    function disableField(field){
         field.disabled=true;
    }
    How do i disable the field & in the same time able to send it's actual data to the server & back?

    Thanks.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    I suggest you read the html specification. Disabled input fields DON'T send the data included READONLY fields do include data in the request. It is clearly explained in the html specification.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3

    Default

    Hi Martin,

    Thanks for your quick reply. I wasn't aware of the fact that readOnly/disabled input field doesn't send data to the server.

    However, can you supply me with a way to overcome this issue?
    I simply need to disable my form:input field & to be able to use it's data in the server later.

    Thanks!

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    I suggest re-reading my post....

    Disabled input fields DON'T send the data included READONLY fields do include data in the request
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •