"CK" <> wrote in message
news:cy3kf.26631$q%. om...
> function validate()
> {
> var Medical = document.getElementById('Medical');
> //alert(Medical.checked);
> Medical.checked = true; //I think it's something like this
> }
Works perfectly.
Would this be the same for all browsers?
I am mainly worried about IE, but there are others that may use other
browsers.
Thanks,
Tom
>
> Hope this helps.
> CK
>
> "tshad" <> wrote in message
> news:%...
>>I am trying to set and clear my checkboxes using client-side validation.
>>
>> I have some Javascript to set my checkboxes:
>>
>> <script language=javascript>
>> function validate(){
>> Medical.checked = 1;
>> }
>> </script>
>>
>> I get an error that says:
>>
>> "Medical" is undefined
>>
>> Here is my asp code:
>>
>> <asp:CheckBox id="Medical" Text="Medical" Checked="false"
>> runat="server"/>
>>
>> and when I look at my page from view source:
>>
>> <input id="Medical" type="checkbox" name="Medical" /><label
>> for="Medical">Medical</label>
>>
>> There is the name "Medical" - so why is Javascript saying it is
>> undefined?
>>
>> Thanks,
>>
>> Tom
>>
>
>
|