Unable to disable text(label) in javascript,working fine with IE, not with MOZILLA

This is a discussion on "Unable to disable text(label) in javascript,working fine with IE, not with MOZILLA" within the JavaScript Forum section. This forum, and the thread "Unable to disable text(label) in javascript,working fine with IE, not with MOZILLA are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 11th, 2007, 08:12
Banned Member
Join Date: Jul 2007
Location: malaysia
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Unable to disable text(label) in javascript,working fine with IE, not with MOZILLA

hi,
I am not able to disable text(label) in javascript,but it's working fine with IE. Not working with MOZILLA..Any one can help regarding this.

I am sending my code..what's wrong with my code

Thanks in Advance

Regards
Balaji

Code: Select all
<!-- 
     [START] PUT FILE DETAILS AND VERSION HERE 

    U98002 - Forex Instrument Parameter Maintenance
    Author : Bhanu Balaji Guddanti
    Functionality : Forex Instrument Parameter Maintenance
    Version : v 1.0.0 

     [END] PUT FILE DETAILS AND VERSION HERE 
-->

<!-- [START] DO NOT REMOVE -->

<%@ include file="../banker-common/taglibs.jsp"%>
<%@ page import="microlink.bankerdesktop.web.module.xs.randGen"%>
<%randGen rg=new randGen();%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html:html>
<html:base/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
    <link rel="stylesheet" href="../../css/common.css" type="text/css">
    <link rel="stylesheet" href="../../css/tabs.css" type="text/css">
    <script language="javascript" src="../../js/tabs.js"></script>
    <script language="javascript" src="../../js/module.js"></script>
<!-- [END] DO NOT REMOVE -->

<!-- [START] PUT CUSTOM JAVASCRIPT HERE -->

    <script language="javascript">
        
          function BLfun()
          {
               
                   var prodtyp = document.forms[0].prodtyp.options[document.forms[0].prodtyp.selectedIndex].value
                var option= document.forms[0]. option.options[document.forms[0]. option.selectedIndex].value
                  
        if((prodtyp=='0008')&&(option=='002'))
                 
                 {
                  document.forms[0].weekend.value='2';
                  document.forms[0].tenor.value='02';
                  document.forms[0].cppdfg.checked=true
                  document.forms[0].cpcyfg.checked=true
                                  
             }
                 if((prodtyp=='0009')&&(option=='002'))
                 {
                  document.forms[0].weekend.value='2';
                  document.forms[0].tenor.value='02';
                  document.forms[0].cppdfg.checked=true
                  document.forms[0].cpcyfg.checked=true
                  document.forms[0].cpperfg.checked=true
                 
             }
                 if((prodtyp=='0008')&&(option=='003'))
                 {
                  
                  document.forms[0].weekend.value='2';
                  document.forms[0].tenor.value='02';
                  document.forms[0].cppdfg.checked=true
                  document.forms[0].cpcyfg.checked=true
              

                  document.getElementById('c1').disabled=true; 
                  document.getElementById('c2').disabled=true;
                  document.getElementById('c3').disabled=true;
                  document.getElementById('d1').disabled=true;
                  document.getElementById('d2').disabled=true;
                  document.getElementById('d3').disabled=true; 
                  document.forms[0].cppdfg.disabled=true;
                  document.forms[0].cpcyfg.disabled=true; 
                  document.forms[0].cpperfg.disabled=true; 
                  document.forms[0].dlrpdfg.disabled=true; 
                  document.forms[0].dlrcyfg.disabled=true; 
                  document.forms[0].dlrperfg.disabled=true; 
                 }                 
                  if((prodtyp=='0009')&&(option=='003'))
                 {
                  document.forms[0].weekend.value='2';
                  document.forms[0].tenor.value='02';
                  document.forms[0].cppdfg.checked=true
                  document.forms[0].cpcyfg.checked=true
                  document.forms[0].cpperfg.checked=true 
                  document.getElementById('c1').disabled=true;
                  document.getElementById('c2').disabled=true;
                  document.getElementById('c3').disabled=true;
                  document.getElementById('d1').disabled=true;
                  document.getElementById('d2').disabled=true;
                  document.getElementById('d3').disabled=true;
                  document.forms[0].cppdfg.disabled=true;
                  document.forms[0].cpcyfg.disabled=true;
                  document.forms[0].cpperfg.disabled=true; 
                  document.forms[0].dlrpdfg.disabled=true; 
                  document.forms[0].dlrcyfg.disabled=true; 
                  document.forms[0].dlrperfg.disabled=true;  
                 
                 }    
                  if((prodtyp=='0008')&&(option=='004'))
                 {
                  
                  document.forms[0].weekend.value='2';
                  document.forms[0].tenor.value='02';
                  document.forms[0].cppdfg.checked=true
                  document.forms[0].cpcyfg.checked=true
              

                  document.getElementById('c1').disabled=true; 
                  document.getElementById('c2').disabled=true;
                  document.getElementById('c3').disabled=true;
                  document.getElementById('d1').disabled=true;
                  document.getElementById('d2').disabled=true;
                  document.getElementById('d3').disabled=true; 
                  document.forms[0].cppdfg.disabled=true;
                  document.forms[0].cpcyfg.disabled=true; 
                  document.forms[0].cpperfg.disabled=true; 
                  document.forms[0].dlrpdfg.disabled=true; 
                  document.forms[0].dlrcyfg.disabled=true; 
                  document.forms[0].dlrperfg.disabled=true; 
                 }                 
                  if((prodtyp=='0009')&&(option=='004'))
                 {
                  document.forms[0].weekend.value='2';
                  document.forms[0].tenor.value='02';
                  document.forms[0].cppdfg.checked=true
                  document.forms[0].cpcyfg.checked=true
                  document.forms[0].cpperfg.checked=true 
                  document.getElementById('c1').disabled=true;
                  document.getElementById('c2').disabled=true;
                  document.getElementById('c3').disabled=true;
                  document.getElementById('d1').disabled=true;
                  document.getElementById('d2').disabled=true;
                  document.getElementById('d3').disabled=true;
                  document.forms[0].cppdfg.disabled=true;
                  document.forms[0].cpcyfg.disabled=true;
                  document.forms[0].cpperfg.disabled=true; 
                  document.forms[0].dlrpdfg.disabled=true; 
                  document.forms[0].dlrcyfg.disabled=true; 
                  document.forms[0].dlrperfg.disabled=true;  
                 
                 }    
       }

    </script>

<!-- [END] PUT CUSTOM JAVASCRIPT HERE -->

</head>

<body>
<html:form action="/U98004" method="post">

  <!-- [START] SAFE TO EDIT -->
   <input type="hidden" name="ejfno" value="<%=rg.myMethod ()%>"/>

  <table width="100%"  border="0" cellpadding="2" cellspacing="2">
    <tr>
      <td  class="tableheader" colspan="10">SM U98004 Murabaha Instrument Parameter Maintenance</td>
    </tr>
    <tr>
      <td  class="redtext" colspan="10"><html:errors/></td>
    </tr>
    <tr>
      <td colspan="3" class="labeltext">Transaction Code</td>
      <td width="1%"  class="blanktext">:</td>
      <td width="84%" colspan="2" class="blanktext">
       <html:text property="transactioncode" styleClass="textfield" size="3" maxlength="30" value="U98" readonly="true"/>
          <html:select property="dscpt" styleClass="dropdown" value="${U98004.dscpt}" style="width:210px">
          <html:option value="004">004 - MURABAHA</html:option>
      </html:select>
      </td>
    </tr>
    <tr>
      <td colspan="3" class="labeltext">Option</td>
      <td width="1%"  class="blanktext">:</td>
      <td colspan="2" class="blanktext">
        <html:select property="option" styleClass="dropdown" value="" style="width:150px" onblur="disabled=true">
          <html:option value=" "> </html:option>
          <html:option value="001">001 - CREATE</html:option>
          <html:option value="002">002 - UPDATE</html:option>
          <html:option value="003">003 - DELETE</html:option>
          <html:option value="004">004 - ENQUIRY</html:option>
        </html:select>
      </td>
     
    </tr>
    <tr>
      <td colspan="3" class="labeltext">Product Type</td>
      <td width="1%"  class="blanktext">:</td>
      <td colspan="2" class="blanktext">
        <html:select property="prodtyp" styleClass="dropdown" value="" style="width:250px" onblur="BLfun()">
          <html:option value=" "> </html:option>
          <html:option value="0008">0008 - MURABAHA</html:option>
          <html:option value="0009">0009 - REVERSE MURABAHA</html:option> 
          
       </html:select>
      </td>
   </tr>
    <tr>
      <td colspan="3" class="labeltext">weekend</td>
      <td width="1%"  class="blanktext">:</td>
      <td colspan="2" class="blanktext">
        <html:select property="weekend" styleClass="dropdown" value="" style="width:90px">
         <html:option value=" "> </html:option>
         <html:option value="1">1 - YES</html:option>
         <html:option value="2">2 - NO</html:option>
        </html:select>
      </td>
    </tr>
    
    <tr>
      <td colspan="3" class="labeltext">Tenor</td>
      <td width="1%"  class="blanktext">:</td>
      <td colspan="2" class="blanktext">
        <html:select property="tenor" styleClass="dropdown" value="" style="width:150px">
         <html:option value=" "> </html:option>
         <html:option value="01">01 - BY MONTH</html:option>
         <html:option value="02">02 - BY DAY</html:option>
        </html:select>
      </td>
    </tr>
 </table>  
     <p>&nbsp;</p> 
    <table width=100% id="mytable" >
    <tr>
    
     <td width="3%" class="blanktext">
        <html:checkbox property="cppdfg" value="1"/>
      </td>
      <td width="19%" ><label id="c1" >CounterParty Product Limit</label></td>
      <td width="3%" class="blanktext" >&nbsp;</td>
      <td colspan="3" class="blanktext">
        <html:checkbox property="dlrpdfg" value="1"/>      </td>
      <td width="14%" class="blanktext" id="d1">Dealer Product Limit</td>
      <td width="37%" class="blanktext">&nbsp;</td>
      <td width="21%" class="blanktext">&nbsp;</td>
      </tr>
      <tr>
      <td>&nbsp;</td>
      </tr>
    <tr>
      <td class="blanktext">
        <html:checkbox property="cpcyfg" value="1"/>
      </td>
      <td class="labeltext" id="c2">CounterParty Currency Limit</td>
      <td class="blanktext">&nbsp;</td>
      <td colspan="3" class="blanktext">
        <html:checkbox property="dlrcyfg" value="1"/>      </td>
      
      <td class="labeltext" id="d2" >Dealer Currency Limit</td>
      <td class="blanktext">&nbsp;</td>
      <td class="blanktext">&nbsp;</td>
    </tr>
    <tr>
     <td> &nbsp;
     </td>
    </tr>
    <tr>
        
      <td height="23" class="blanktext">
        <html:checkbox property="cpperfg" value="1"/>
      </td>
      <td height="23" class="labeltext" id="c3">CounterParty Per Deal Limit      </td>
      <td height="23" class="blanktext">&nbsp;</td>
      <td height="23" colspan="3" class="blanktext">
      <html:checkbox property="dlrperfg" value="1"/>      </td>
      <td height="23" class="labeltext" id="d3">Dealer Per Deal Limit</td>
      <td height="23" class="blanktext">&nbsp;</td>
      <td height="23" class="blanktext">&nbsp;</td>
    </tr>

   </table>  
  

  <!-- [END] SAFE TO EDIT -->

</html:form>
</body>
</html:html>
Reply With Quote

  #2 (permalink)  
Old Jul 11th, 2007, 09:55
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,619
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Unable to disable text(label) in javascript,working fine with IE, not with MOZILL

I think it's because the 'disabled' properly doesn't apply to labels, only form elements. IE doesn't respect standards, which is why it works. Firefox does, which is why it doesn't seem to work.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
Reply

Tags
disable, text, unable

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript working fine in IE but cannot work in Firefox web20tester JavaScript Forum 0 May 21st, 2007 17:37
asp:Label text in javascript QuikFrozen ASP.NET Forum 1 Aug 17th, 2006 13:11
Working fine but giving error clickme_not JavaScript Forum 3 Apr 28th, 2006 18:36
Flash/ASP login (Working FINE except for parse first+last name) mitcho Classic ASP 4 Dec 21st, 2005 21:18
odd slideshow problem (fine in IE, not in Mozilla) jono JavaScript Forum 7 Mar 17th, 2005 08:42


All times are GMT. The time now is 22:34.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43