Cold Fusion Development
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Remember me

Go Back   Dev Articles Community ForumsProgrammingCold Fusion Development

Add This Thread To:   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
Unread Dev Articles Community Forums Sponsor:
Old December 22nd, 2008, 10:56 PM
susan_151615 susan_151615 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
Join Date: Dec 2008
Posts: 4 susan_151615 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 40 m 14 sec
Reputation Power: 0
Disabling a dropdown based on javascript

Hi I have a web page.Where i display a row of dropdown list s nearly 5 rows i display .When i choose any value from the main dropdown the other dropdown will get enabled but at the same time when i choose null value from the drop down,all the others will get disabled and they will also sho blank value.

Using array i wrote a javascript function to enable and disable it.It works quite fine

Now my problem is i have a feature"Add arow and delete a row"

When i add a row a row with the dropdown list will get added to already prsent dropdown and it should also do the same functionality(enabling and disabling) but its not working as required

The array way of adding and deleting a row which i did is:

function fnAddDelRows(valRowId){
if ((varNoofRows+valRowId>=5) && (varNoofRows+valRowId<=10)){
if (varNoofRows<10){'hand';
if (varNoofRows>5){'hand';
if (varNoofRows==5){'';
if (varNoofRows==10){'';
document.getElementById("row" + varNoofRows).style.display='block';
document.getElementById("row" + (varNoofRows + 1)).style.display='none';

the javascript which i wrote isfor anabling and disabling is)

<script language="javascript">
function fnenable(varIndex){
if(document.AdminChkReq.cmbDeptNo(varIndex).value != '')
document.AdminChkReq.cmbAcctNo(varIndex).disabled= false;
document.AdminChkReq.cmbSubAcct(varIndex).disabled =false;
document.AdminChkReq.cmbProjNo(varIndex).disabled= false;
document.AdminChkReq.cmbAcctCateg(varIndex).disabl ed=false;
document.AdminChkReq.txtDistAmt(varIndex).disabled =false;
document.AdminChkReq.cmbAcctNo(varIndex).disabled= true;
document.AdminChkReq.cmbSubAcct(varIndex).disabled =true;
document.AdminChkReq.cmbProjNo(varIndex).disabled= true;
document.AdminChkReq.cmbAcctCateg(varIndex).disabl ed=true;
document.AdminChkReq.txtDistAmt(varIndex).disabled =true;
document.AdminChkReq.cmbSubAcct(varIndex).value='' ;
document.AdminChkReq.cmbAcctCateg(varIndex).value= '';
document.AdminChkReq.txtDistAmt(varIndex).value='' ;

Can anyone help me in sorting out this

Reply With Quote

Viewing: Dev Articles Community ForumsProgrammingCold Fusion Development > Disabling a dropdown based on javascript

Developer Shed Advertisers and Affiliates

Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.

© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap