Forum Moderators: open
My form contains address information displayed in text fields. By default the fields are disabled.
example:
<input type="Text" name="custAddress" size="25" maxlength="50" value="<%= businessObject.getAddress() %>" disabled>
The user can override the pre-populated address information by changing the 'Drop Ship' value from N to Y.
example:
<input type="Text" name="custDropShip" size="1" maxlength="1" value="N" onBlur="YesNoDS(this.value.toUpperCase())">
The YesNoDS(string) function clears the address field and enables it for data entry.
example:
function YesNoDS(answer)
{
try
{
if (answer == "Y")
{
document.form.custAddress.value = "";
document.form.custAddress.disabled=false;
}
}
catch (err)
{
alert("Debug: err = " + err);
}
}
The script works fine as it is.
I made the following changes:
<input type="Text" name="custAddress" size="25" maxlength="50" value="<%= businessObject.getAddress() %>" readonly>
document.form.custAddress.readonly=false;
Now I get the debug message in the catch block:
Debug: err = Object Error
I need the address value when I submit the form. That's why I changed it from disabled to readonly.
Isn't readonly a boolean attribute like disabled is? I assume I can set it to false at run time.