424,303 Members | 1,366 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,303 IT Pros & Developers. It's quick & easy.

Unable to disable the text(label) in javascript

P: 1
hi,
I am unable to disable the text(label) in javascript..it's working fine with IE,but i am using MOZILLA..
can any one help regarding this..

What's the wrong with my code?
I am sending my code here..

Thanks in Advance...

Regards
Bhanu


[html]

<!--
[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.rand Gen"%>
<%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 -->
[/html]
Expand|Select|Wrap|Line Numbers
  1. <!-- [START] PUT CUSTOM JAVASCRIPT HERE -->
  2.  
  3.     <script language="javascript">
  4.  
  5.           function BLfun()
  6.           {
  7.  
  8.                    var prodtyp = document.forms[0].prodtyp.options[document.forms[0].prodtyp.selectedIndex].value
  9.                 var option= document.forms[0]. option.options[document.forms[0]. option.selectedIndex].value
  10.  
  11.         if((prodtyp=='0008')&&(option=='002'))
  12.  
  13.                  {
  14.                   document.forms[0].weekend.value='2';
  15.                   document.forms[0].tenor.value='02';
  16.                   document.forms[0].cppdfg.checked=true
  17.                   document.forms[0].cpcyfg.checked=true
  18.  
  19.              }
  20.                  if((prodtyp=='0009')&&(option=='002'))
  21.                  {
  22.                   document.forms[0].weekend.value='2';
  23.                   document.forms[0].tenor.value='02';
  24.                   document.forms[0].cppdfg.checked=true
  25.                   document.forms[0].cpcyfg.checked=true
  26.                   document.forms[0].cpperfg.checked=true
  27.  
  28.              }
  29.                  if((prodtyp=='0008')&&(option=='003'))
  30.                  {
  31.  
  32.                   document.forms[0].weekend.value='2';
  33.                   document.forms[0].tenor.value='02';
  34.                   document.forms[0].cppdfg.checked=true
  35.                   document.forms[0].cpcyfg.checked=true
  36.  
  37.  
  38.                   document.getElementById('c1').disabled=true; 
  39.                   document.getElementById('c2').disabled=true;
  40.                   document.getElementById('c3').disabled=true;
  41.                   document.getElementById('d1').disabled=true;
  42.                   document.getElementById('d2').disabled=true;
  43.                   document.getElementById('d3').disabled=true; 
  44.                   document.forms[0].cppdfg.disabled=true;
  45.                   document.forms[0].cpcyfg.disabled=true; 
  46.                   document.forms[0].cpperfg.disabled=true; 
  47.                   document.forms[0].dlrpdfg.disabled=true; 
  48.                   document.forms[0].dlrcyfg.disabled=true; 
  49.                   document.forms[0].dlrperfg.disabled=true; 
  50.                  }                 
  51.                   if((prodtyp=='0009')&&(option=='003'))
  52.                  {
  53.                   document.forms[0].weekend.value='2';
  54.                   document.forms[0].tenor.value='02';
  55.                   document.forms[0].cppdfg.checked=true
  56.                   document.forms[0].cpcyfg.checked=true
  57.                   document.forms[0].cpperfg.checked=true 
  58.                   document.getElementById('c1').disabled=true;
  59.                   document.getElementById('c2').disabled=true;
  60.                   document.getElementById('c3').disabled=true;
  61.                   document.getElementById('d1').disabled=true;
  62.                   document.getElementById('d2').disabled=true;
  63.                   document.getElementById('d3').disabled=true;
  64.                   document.forms[0].cppdfg.disabled=true;
  65.                   document.forms[0].cpcyfg.disabled=true;
  66.                   document.forms[0].cpperfg.disabled=true; 
  67.                   document.forms[0].dlrpdfg.disabled=true; 
  68.                   document.forms[0].dlrcyfg.disabled=true; 
  69.                   document.forms[0].dlrperfg.disabled=true;  
  70.  
  71.                  }    
  72.                   if((prodtyp=='0008')&&(option=='004'))
  73.                  {
  74.  
  75.                   document.forms[0].weekend.value='2';
  76.                   document.forms[0].tenor.value='02';
  77.                   document.forms[0].cppdfg.checked=true
  78.                   document.forms[0].cpcyfg.checked=true
  79.  
  80.  
  81.                   document.getElementById('c1').disabled=true; 
  82.                   document.getElementById('c2').disabled=true;
  83.                   document.getElementById('c3').disabled=true;
  84.                   document.getElementById('d1').disabled=true;
  85.                   document.getElementById('d2').disabled=true;
  86.                   document.getElementById('d3').disabled=true; 
  87.                   document.forms[0].cppdfg.disabled=true;
  88.                   document.forms[0].cpcyfg.disabled=true; 
  89.                   document.forms[0].cpperfg.disabled=true; 
  90.                   document.forms[0].dlrpdfg.disabled=true; 
  91.                   document.forms[0].dlrcyfg.disabled=true; 
  92.                   document.forms[0].dlrperfg.disabled=true; 
  93.                  }                 
  94.                   if((prodtyp=='0009')&&(option=='004'))
  95.                  {
  96.                   document.forms[0].weekend.value='2';
  97.                   document.forms[0].tenor.value='02';
  98.                   document.forms[0].cppdfg.checked=true
  99.                   document.forms[0].cpcyfg.checked=true
  100.                   document.forms[0].cpperfg.checked=true 
  101.                   document.getElementById('c1').disabled=true;
  102.                   document.getElementById('c2').disabled=true;
  103.                   document.getElementById('c3').disabled=true;
  104.                   document.getElementById('d1').disabled=true;
  105.                   document.getElementById('d2').disabled=true;
  106.                   document.getElementById('d3').disabled=true;
  107.                   document.forms[0].cppdfg.disabled=true;
  108.                   document.forms[0].cpcyfg.disabled=true;
  109.                   document.forms[0].cpperfg.disabled=true; 
  110.                   document.forms[0].dlrpdfg.disabled=true; 
  111.                   document.forms[0].dlrcyfg.disabled=true; 
  112.                   document.forms[0].dlrperfg.disabled=true;  
  113.  
  114.                  }    
  115.        }
  116.  
  117.     </script>
  118.  
  119. <!-- [END] PUT CUSTOM JAVASCRIPT HERE -->
  120.  
[html]
</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>
[/html]
Jul 11 '07 #1
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,204
hi

?? ... explain your problem and post some code you have done already ...

kind regards
Jul 11 '07 #2

acoder
Expert Mod 15k+
P: 16,027
hi

?? ... explain your problem and post some code you have done already ...
You might be wondering: "where did that come from?!"

Unfortunately, there's a bug when using code tags. If you put too much code int one set of tags, it just shows a blank post. I've edited the original post so that you can see the post in all its glory!
Jul 11 '07 #3

gits
Expert Mod 5K+
P: 5,204
You might be wondering: "where did that come from?!"

Unfortunately, there's a bug when using code tags. If you put too much code int one set of tags, it just shows a blank post. I've edited the original post so that you can see the post in all its glory!
;) thanks ... good to know ... and now i can see the post and the code too ...

@bhanubalaji

hmmm ... i think something like:

Expand|Select|Wrap|Line Numbers
  1. <html:text property="transactioncode" ...
is rendered as regular html-code at runtime? so that it becomes:

Expand|Select|Wrap|Line Numbers
  1. <input type="text" ...
and can you set the correct properties of the desired nodes?

open up the mozilla- or firefox-js-console and have a look at the errors that appear ...

kind regards
Jul 11 '07 #4

Post your reply

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