Solved

firefox compatability

Posted on 2012-03-27
5
230 Views
Last Modified: 2012-03-29
i want to disable tab im using this code
document.getElementById('tabxyz').disabled="true";
it is working ie8 and it is not working in firefox10
any alternative solution for this?
0
Comment
Question by:srikotesh
  • 3
  • 2
5 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37772676
Can you elaborate a little. What do you mean by a "tab". What is the actual html element? Can you provide more context?
0
 
LVL 1

Author Comment

by:srikotesh
ID: 37775015
<table cellpadding="0" cellspacing="0"  width="780px" border="0">
                                            <tr style="height:22px">
                                                <td id="Testtab1ControlObjM" class="TabItemStyleOn" style="width:150px; height:22px;" onclick="tabClicked('Test',1,3);" align="center">General</td>
                                                <td id="Testtab1ControlObjR" class="TabItemStyleOnOff" style="width:25px; height:22px;"></td>
                                                <td id="Testtab2ControlObjM" name="Testtab2ControlObjM" class="TabItemStyleOff" style="width:130px;height:22px;" onclick="tabClicked('Test',2,3);" align="center" >Medical</td>
                                                <td id="Testtab2ControlObjR" name="Testtab2ControlObjR"  class="TabItemStyleOffOff" style="width:25px; height:22px;"></td>
 </tr>
 </table>


document.getElementById('Testtab2ControlObjM').disabled = true;                        
document.getElementById('Testtab2ControlObjR').disabled = true;

im using like this it working in ie showing the tab in disable mode, but problem with ffox
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37775055
Try this:

document.getElementById('Testtab2ControlObjM').removeAttribute("onclick");                        
document.getElementById('Testtab2ControlObjR').removeAttribute("onclick");

If you need to re-enable them do this:

document.getElementById('Testtab2ControlObjM').setAttribute("onclick", "tabClicked('Test',2,3);");                        
document.getElementById('Testtab2ControlObjR').setAttribute("onclick","tabClicked('Test',2,3);");
0
 
LVL 1

Author Comment

by:srikotesh
ID: 37780367
yes this code is working fine but tab has to show disable mode
for that i added another line is there any alternative instead of that line

 document.getElementById('Testtab2ControlObjM').style.color='Gray';                          document.getElementById('Testtab2ControlObjM').removeAttribute("onclick");                
                          document.getElementById('Testtab2ControlObjR').removeAttribute("onclick");
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 37781106
Your tab is a table cell. It does not have a disable attribute like a button or textbox. Without changing to a standard input element, I would say what you have is workable.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now