Click to See Complete Forum and Search --> : select1.disabled = true fails in VID project
codefinger
April 4th, 2002, 10:19 AM
I have several combo boxes on my page that I want to disable/enable in
VBscript.
The properties window shows I can set select1.disabled = true at design
time, and that works.
The intellisense shows the select1.disabled as an option when I am coding
it. But when the page is viewed in browser and that code is called, IE says
"object does not support this property or method"!
Where did I go wrong?
Also, if anyone has any code that shows me how to add items to the combo box
and set its display value to one of those items, I would be very grateful.
It apparently is not quite as simple as VB.
I tried select1.add "Item" and got a type mismatch error.
Any and all assistance greatly appreciated. Thanks in advance.
Akim
April 4th, 2002, 12:20 PM
I'm not a Pro WED developer, but I tested select1.disabled = true and it works on my comp (both, VBscript and JavaScript versions).
VS SP5 and IE 6. You might want to check Script compatibility.
codefinger
April 10th, 2002, 03:26 PM
Okay, I have made the page available at:
http://www.bytesizedsystems.com/aspfiles/electriccvc.asp
To test, load the page, then click anywhere on the white box on the left (select5). The code to disable the combobox (select8) is on select5's onclick event (obviously I'm going to have to give these things better names soon...)
Maybe now that the source code is available, it will be easier for someone to help me with the problem.
Thanks in advance.
Akim
April 10th, 2002, 04:30 PM
Here is your HTML for Select8:
TD noWrap align=left><STRONG>DX:</STRONG><SELECT id=select8
style="DISPLAY: none; LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled
name=select8> <option selected></option></SELECT><SELECT id=select8
style="LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled name=select8>
<option selected></option></SELECT><SELECT id=select8
style="LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled name=select8>
<option selected></option></SELECT><SELECT id=select8
style="LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled name=select8>
<option selected></option></SELECT></TD>
All 4 boxes have same IDs and same names. Change name or ID and you'll have it working.
Here is my version:
<TD noWrap align=left><STRONG>DX:</STRONG><SELECT id=select8
style="DISPLAY: inline; LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled
name=select81> <option selected></option></SELECT><SELECT id=select8
style="LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled name=select82>
<option selected></option></SELECT><SELECT id=select8
style="LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled name=select83>
<option selected></option></SELECT><SELECT id=select8
style="LEFT: 434px; WIDTH: 128px; TOP: 2px" disabled name=select84>
<option selected></option></SELECT></TD>
On click:
Sub select5_onclick
select8("select81").disabled = false
select8("select82").disabled = false
select8("select83").disabled = false
select8("select84").disabled = false
End Sub
Hope that helps.
Don't rate me, I know what I know and help when I can. Numbers means nothing.
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.