Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Disabled Field is giving NULL Value when the form is being submitted

843838Sep 4 2006 — edited Sep 4 2006
Hello,

I'm using Struts and EJB for my application. I've one checkbox field and three fields for username, password and confirm password (two textboxes and one password fields).

My Scenario is:

Initially, i've entered all the values in the text-boxes and password field without checking the check-box and the submit button has been pressed and the page has been forward to the same page and the entered values are displayed again.

Now, when i check the check-box, three fields has been made disabled (Pls. refer the code below) and again click on Submit button, the values in the text-boxes and password fields are not getting appeared in the fields.

Here is the Struts Code:
<html:checkbox name="form1" property="aocUser" value="true" styleClass="radiocheck" onclick="javascript:disableCustomerUserPassword();" /> AOC USER
<c:choose>
<c:when test="${form1.aocUser=='true'}">
<td width="200" height="26"><html:text name="form1" property="customerUserName" maxlength="100" tabindex="34" styleClass="formfield" disabled="true" /></td>
</c:when>
<c:otherwise>
<td width="200" height="26"><html:text name="form1" property="customerUserName" maxlength="100" tabindex="34" styleClass="formfield" /></td>
</c:otherwise>
</c:choose>
Here is the Javascipt Function:
function disableCustomerUserPassword() {		
if(document.getElementById("aocUser").checked)
{
document.form1.customerUserName.disabled=true;
document.form1.customerUserPassword.disabled=true;
document.form1.confirmCustomerUserPassword.disabled=true;
}
else
{
document.form1.customerUserName.disabled=false;
document.form1.customerUserPassword.disabled=false;
document.form1.confirmCustomerUserPassword.disabled=false;
}		
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2006
Added on Sep 4 2006
2 comments
817 views