Spry: Conditionally Fields -
10-09-2007
, 12:13 PM
Hi,
I am using DW CS3 to create spry fields.
I have a situation in which I want one field to become required based upon the
value of another field. In my page I added the following:
var chkOtherValid = function(value, options){
var sel = document.getElementById("Chk");
var Chk_value = sel.options[sel.selectedIndex].value;
if ((Chk_value == 'OTH') && (value == '')) {
return false;
}
return true;
}
var chkOtherValid = new
Spry.Widget.ValidationTextField("spryChkOther", "custom",
{isRequired:false});
Within my form I have the following:
<span id="spryChkOther">
<input type="text" name="ChkOth"
size="23" maxlength="15"
onblur="this.value=this.value.toUpperCase();" />
<span class="textfieldRequiredMsg">A value is required.</
span></span> </td>
</tr>
My problem is that I am no getting the expected result.
Can someone please help me.
Thank You.
Regards,
Al |