473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Combobox is not disabled

46
Hi!
I have a combobox,it should be disabled when i select a value(say "post") from another combobox.it is working in IE but not in mozilla...can anybody help me??i'm sending the code....
Regards

Expand|Select|Wrap|Line Numbers
  1. Select.draw(out,connectionStr, "cmbtype", "", "","", -1,"", true, "",false)
  2.  
  3. Select.draw( out, connectionStr , "cmbState", "Arial12px", "", -1, true, "", "","","","")
  4.  
  5. if(document.frmIns.cmbtype[document.frmIns.cmbtype.selectedIndex].text.indexOf("Post")!="-1")
  6.  {
  7.  
  8.    document.getElementById('cbmState').disabled=true;
  9. }
  10. else
  11. {
  12. document.getElementById('cbmState').disabled=false;
  13. }
Aug 7 '07 #1
11 2393
dmjpro
2,476 2GB
Hi!
I have a combobox,it should be disabled when i select a value(say "post") from another combobox.it is working in IE but not in mozilla...can anybody help me??i'm sending the code....
Regards

Expand|Select|Wrap|Line Numbers
  1. Select.draw(out,connectionStr, "cmbtype", "", "","", -1,"", true, "",false)
  2.  
  3. Select.draw( out, connectionStr , "cmbState", "Arial12px", "", -1, true, "", "","","","")
  4.  
  5. if(document.frmIns.cmbtype[document.frmIns.cmbtype.selectedIndex].text.indexOf("Post")!="-1")
  6.  {
  7.  
  8.    document.getElementById('cbmState').disabled=true;
  9. }
  10. else
  11. {
  12. document.getElementById('cbmState').disabled=false;
  13. }

Edit this line ...

Expand|Select|Wrap|Line Numbers
  1. if(document.frmIns.cmbtype.options[document.frmIns.cmbtype.selectedIndex].text.indexOf("Post")!=-1)
  2.  
Wish u best of luck....!!!
Aug 7 '07 #2
honey99
46
Edit this line ...

Expand|Select|Wrap|Line Numbers
  1. if(document.frmIns.cmbtype.options[document.frmIns.cmbtype.selectedIndex].text.indexOf("Post")!=-1)
  2.  
Wish u best of luck....!!!

Thank u...but my problem is the below line is not working in mozilla

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('cmbState').disabled=true  
'cmbState' is the string name that I gave to combobox..plz check the above code and tell me a solution...
Aug 7 '07 #3
acoder
16,027 Expert Mod 8TB
Thank u...but my problem is the below line is not working in mozilla

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('cmbState').disabled=true  
'cmbState' is the string name that I gave to combobox..plz check the above code and tell me a solution...
Is it "cmb" or "cbm"? Check that that is indeed the id of the select and not just the name. If you're using getElementById, the ID should be present. IE erroneously uses the name for the id resulting in poor coding which causes problems in other browsers. Don't test in IE first - use it last.
Aug 7 '07 #4
honey99
46
Is it "cmb" or "cbm"? Check that that is indeed the id of the select and not just the name. If you're using getElementById, the ID should be present. IE erroneously uses the name for the id resulting in poor coding which causes problems in other browsers. Don't test in IE first - use it last.
it's 'cmbState' only not 'cbmstate'..and plz tell me how to give id to the select ...let me know through an example...
Aug 7 '07 #5
acoder
16,027 Expert Mod 8TB
it's 'cmbState' only not 'cbmstate'..and plz tell me how to give id to the select ...let me know through an example...
You give an id just like you would give a name. It's simply an attribute:
[HTML]<select name="cmbState" id="cmbState"></select>[/HTML]
Aug 7 '07 #6
honey99
46
You give an id just like you would give a name. It's simply an attribute:
[HTML]<select name="cmbState" id="cmbState"></select>[/HTML]
Thank u but i want to know how to give id to select tag in this syntax

Select.draw( out, connectionStr , "cmbState", "Arial12px", "", -1, true, "", qryStr,new String[] {"es001"}, new String[] {"es002"}, model.getState(), Select.EMPTY_OPTION|Select.EMPTY_AT_TOP );
Aug 7 '07 #7
acoder
16,027 Expert Mod 8TB
Thank u but i want to know how to give id to select tag in this syntax

Select.draw( out, connectionStr , "cmbState", "Arial12px", "", -1, true, "", qryStr,new String[] {"es001"}, new String[] {"es002"}, model.getState(), Select.EMPTY_OPTION|Select.EMPTY_AT_TOP );
Can you show me the code for the draw method?
Aug 7 '07 #8
honey99
46
Can you show me the code for the draw method?
the code for select.draw is

Expand|Select|Wrap|Line Numbers
  1. Select.draw( out, connectionStr , "cmbState", "Arial12px", "", -1, true, "", qryStr,new String[] {"es001"}, new String[] {"es002"}, model.getState(), Select.EMPTY_OPTION|Select.EMPTY_AT_TOP );
Aug 7 '07 #9
acoder
16,027 Expert Mod 8TB
the code for select.draw is

Expand|Select|Wrap|Line Numbers
  1. Select.draw( out, connectionStr , "cmbState", "Arial12px", "", -1, true, "", qryStr,new String[] {"es001"}, new String[] {"es002"}, model.getState(), Select.EMPTY_OPTION|Select.EMPTY_AT_TOP );
No, you're probably using a library/framework of some sort which you must have included.
Aug 7 '07 #10
honey99
46
No, you're probably using a library/framework of some sort which you must have included.
certainly i'm using this syntax for select.draw method.......no other framework i'm using.......
Aug 7 '07 #11
acoder
16,027 Expert Mod 8TB
certainly i'm using this syntax for select.draw method.......no other framework i'm using.......
Is this JSP or Javascript? If it's JSP, you will have some generated source for the select element. If it's Javascript, show the full code.

In fact, just show all relevant code anyway.
Aug 7 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Li Pang | last post by:
I use a combobox control to populate the data. I want to prevent to change data (freeze the data in the filed). The only solution I have is to set Enabled property to "False", but it gray out the...
3
by: Brian Mitchell | last post by:
Is it possible to change the fore and back colors of a combo box when its enabled property is set to false? I need to lock the value of my combo boxes (and still keep its color) but that control...
2
by: Don | last post by:
I've looked high and low for some code that will allow me to have a combobox with a flat borderstyle. I found a few examples, but nothing that was really usable for me. I had the following...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
6
by: Roberto | last post by:
Hi, using vb 2005 I'd like to have a combobox in READONLY mode, like I have for textbox. Combobox only has enabled property. When I turn this property false I can not select the text in the...
4
by: Vish | last post by:
Hi, I need to make the text on a combobox that is disabled to be drawn with a black color. I was not able to find any help on this online. The drawItem seems to apply only for the dropdpwn...
0
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number...
1
by: Saww | last post by:
Hello lately i have been trying to make a custom combobox with a few targets. 1. to create a disabled items 2. to create a seperator item I already managed both properties items. i also managed...
5
by: Kevinp | last post by:
I've spent the last four hours Google searching for a way to disable items in a Combobox. I found one example in C++ which I can't get to work and another in C# that I couldn't get to work either....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.