Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

firefox compatability

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
srikotesh
Asked:
srikotesh
  • 3
  • 2
1 Solution
 
Tom BeckCommented:
Can you elaborate a little. What do you mean by a "tab". What is the actual html element? Can you provide more context?
0
 
srikoteshAuthor Commented:
<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
 
Tom BeckCommented:
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
 
srikoteshAuthor Commented:
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
 
Tom BeckCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now