hi guys, I have an app which starts with a disabled="true" status for a 
TextField (OR a DatePicker) component.
I then wrote a script using the script component to enable the TextField 
component when a certain value is picked using a PropertySelection 
component.

The script correctly picks up the value from the selection component and 
enables the TextField (or datepicker) component halfway. When i say half 
way,
the pop up portion of the datepicker doesnt work and any submits i make to 
the server DOES NOT update the object's field associated with the enabled 
component.

I believe that the actual component is not getting enabled and only the 
static html portion of it is. Is there a way to completely enable the 
component itself using
my script file?


html:
<form jwcid="@Form">
<span jwcid="@Script" script="enableDeliveryDate.script"/>

<td colspan="4">
STD Case Status:&nbsp;
<select name="caseStatusID" size="1" jwcid="[EMAIL PROTECTED]"
model="ognl:caseStatusSelectionModel"
value="ognl:case.caseStatus" 
onchange="enableTF()">
</select> 
</td>

<td>
Delivery Date:&nbsp;
<input type="text" name="deliveryDate" disabled="true"
jwcid="[EMAIL PROTECTED]" value="ognl:case.expectedDeliveryDate">
</input>
</td>

<td>
<input type="submit" value="Save case status" jwcid="@Submit" 
listener="ognl:listeners.saveCaseStatus"/>
</td>

<td>

</td>

</form> 


Script File:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script PUBLIC

"-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"

"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";>

<script>
<body>
<![CDATA[ 
function enableTF() {
if (document.forms[0])
{
if(document.forms[0].caseStatusID.value=="closed pending delivery")
{
document.forms[0].deliveryDate.disabled=false;
document.forms[0].deliveryDate.focus();
}
} 
}
]]>
</body>
<initialization>
</initialization>
</script>




Any help would be much appreciated.
Thanx,
Muhariz.

Reply via email to