Check if form element is disabled 
Author Message
 Check if form element is disabled

I need to check with client-side script if a text box on
the form is enabled or disabled before inserting a new row
of boxes using the InsertAdjacentHTML method.  When I try
to use something like:

if form1.txtBox1.disabled = true then ...

but it bombs on this line and says that "object doesn't
support that method"  Any help would be appreciated.

Thanks in advance,
Steven.



Mon, 02 May 2005 22:49:49 GMT  
 Check if form element is disabled
I'm curious why that doesn't work. Try this,

<html>
<head>
<script language='VBScript'>
sub window_onload
msgbox b.disabled=true then msgbox "d"
end sub
</script>

<body>
<input type=text id=b disabled>

--
Han Pohwan, Microsoft MVP, Seoul, Korea
Mail with any alphabets in the title will be removed. Use only numbers.

Quote:
> I need to check with client-side script if a text box on
> the form is enabled or disabled before inserting a new row
> of boxes using the InsertAdjacentHTML method.  When I try
> to use something like:

> if form1.txtBox1.disabled = true then ...

> but it bombs on this line and says that "object doesn't
> support that method"  Any help would be appreciated.

> Thanks in advance,
> Steven.



Mon, 02 May 2005 23:37:54 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. check for non existent form element Request.Form

2. which form.element am I validating.....

3. What is the best way to disable form elements

4. x-browser way to disable form elements?

5. Enable & Disable Form Text Elements

6. how to disable right-click contextMenu - but enable for form elements

7. Check for content in form-elements before submitting

8. Checking if form element exists

9. print checked elements of form ONLY

10. Check value in a form element

11. Iterating a form of 25000 records to set elements the checked

12. Finding # of specific element in forms elements collection

 

 
Powered by phpBB® Forum Software