473,411 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

reset table values on every onchange

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. $(document).ready(function () {
  3.             $('#ddlCategory').change(function () {  
  4.              $('#db option[value=""]').attr('selected','selected');
  5.  
  6.  
  7.                 if (this.value == "myRow1") { $('#myRow1').show();$('#ASC').show();$('#Bank').show();
  8.                 $('#CHK').show();$('#CLAIMS').show();$('#ENT').show();$('#FSB').show();$('#GC').show();}
  9.                 else {$('#myRow1').hide();  /* $('#ASC').hide();$('#Bank').hide();$('#CHK').hide();
  10.                 $('#CLAIMS').hide();$('#ENT').hide();$('#FSB').hide();$('#GC').hide();*/
  11.                  };
  12.  
  13.                 if (this.value == "myRow2") { $('#myRow2').show(); $('#ASC').show();$('#Bank').show();
  14.                 $('#CHK').show();$('#CLAIMS').show();$('#MEM').show();}
  15.                 else {$('#myRow2').hide(); /* $('#ASC').hide();$('#Bank').hide();$('#CHK').hide();
  16.                 $('#CLAIMS').hide();$('#MEM').hide();*/}
  17.  
  18.                 if (this.value == "Others") { $('#Other').show(); $('#ASC').show();$('#Bank').show();
  19.                 $('#ENT').show();$('#FSB').show();$('#GC').show();$('#MEM').show();$('#PNC').show();$('#SDR').show();}
  20.                 else {$('#Other').hide();  /*$('#ASC').hide();$('#Bank').hide();$('#ENT').hide();$('#FSB').hide();
  21.                 $('#GC').hide();$('#MEM').hide();$('#PNC').hide();$('#SDR').hide();*/} 
  22.  
  23.  
  24.             });
  25.  
  26.            $('#db').change(function () {
  27.          $('#ddlCategory option[value=""]').attr('selected','selected');
  28.             if (this.value == "ASC") { $('#ASC').show();} else {$('#ASC').hide(); }
  29.             if (this.value == "Bank") { $('#Bank').show();} else {$('#Bank').hide(); }
  30.             if (this.value == "CHK") { $('#CHK').show();} else {$('#CHK').hide(); }
  31.             if (this.value == "CLAIMS") { $('#CLAIMS').show();} else {$('#CLAIMS').hide(); }
  32.             if (this.value == "ENT") { $('#ENT').show();} else {$('#ENT').hide(); }
  33.             if (this.value == "FSB") { $('#FSB').show();} else {$('#FSB').hide(); }
  34.             if (this.value == "GC") { $('#GC').show();} else {$('#GC').hide(); }
  35.             if (this.value == "MEM") { $('#MEM').show();} else {$('#MEM').hide(); }
  36.             if (this.value == "PNC") { $('#PNC').show();} else {$('#PNC').hide(); }
  37.             if (this.value == "SDR") { $('#SDR').show();} else {$('#SDR').hide(); }
  38.             });
  39.  
  40.           });
  41.  
  42.  
  43.  
  44.         </script>
  45.  
  46. <body >
  47.  
  48.   <select id="ddlCategory">
  49.                         <option value="">JVM</option>
  50.                         <option value="myRow1">DCTM</option>
  51.                         <option value="myRow2">mem_wd</option>
  52.                         <option value="Others">blk</option>
  53.                     </select>
  54.     <select id="db" style="width: 155px">
  55.         <option value="">Cosa</option>
  56.         <option value="ASC">ASC</option>
  57.         <option value="Bank">Bank</option>
  58.         <option value="CHK">CHK</option>
  59.         <option value="CLAIMS">CLAIMS</option>
  60.         <option value="ENT">ENT</option>
  61.         <option value="FSB">FSB</option>
  62.         <option value="GC">GC</option>
  63.         <option value="MEM">MEM</option>
  64.         <option value="PNC">PNC</option>
  65.         <option value="SDR">SDR</option>
  66.     </select>
  67.     &nbsp;<br />
  68.     <hr />
  69.     &nbsp;&nbsp;<br />
  70.   <table id="t1">
  71.             <tr><th>JVM</th><th>Impact</th><th>DocBase</th></tr>
  72.             <tr id="myRow1" style="display: none" bgcolor="#00FF00">
  73.             <td style="height: 22px">dctm</td>
  74.             <td style="height: 22px">msr member</td>
  75.             <td style="width: 124px; height: 22px;">ASC-Bank-Chk-Claims-ENT-FSB-GC</td>
  76.             </tr>
  77.  
  78.             <tr id="myRow2" style="display: none" bgcolor="#00FF00">
  79.             <td align="center">mem_wd</td>
  80.             <td>member-messaging</td>
  81.             <td style="width: 124px">ASC-Bank-Chk-Claims-MEM-</td>
  82.             </tr>
  83.  
  84.             <tr id="Other" style="display: none" bgcolor="#00FF00">
  85.             <td align="center">blk</td>
  86.             <td>bulk_injestion</td>
  87.             <td style="width: 124px">ASC-Bank-ENT-FSB-GC-MEM-PNC-SDR</td>
  88.             </tr>
  89.         </table>
  90.     <br />
  91.     <hr />
  92.     <br />
  93.     <table id="t2" style="width: 747px; height: 80px" >
  94.     <tr><th>Docbase</th><th>Impact</th><th>Application</th></tr>
  95.         <tr id="ASC" style="display: none" bgcolor="#blue">
  96.             <td style="width: 100px">ASC</td>
  97.             <td style="width: 100px">1</td>
  98.             <td style="width: 100px">2</td>
  99.         </tr>
  100.         <tr id="Bank" style="display: none" bgcolor="#blue">
  101.             <td style="width: 100px; height: 23px;">Bank</td>
  102.             <td style="width: 100px; height: 23px;">1.1</td>
  103.             <td style="width: 100px; height: 23px;">2.2</td>
  104.         </tr>
  105.         <tr id="CHK" style="display: none" bgcolor="#blue">
  106.             <td style="width: 100px">CHK</td>
  107.             <td style="width: 100px">1.3</td>
  108.             <td style="width: 100px">2.3</td>
  109.         </tr>
  110.         <tr id="CLAIMS" style="display: none" bgcolor="#blue">
  111.             <td style="width: 100px">CLAIMS</td>
  112.             <td style="width: 100px">1.4</td>
  113.             <td style="width: 100px">2.4</td>
  114.             </tr>
  115.         <tr id="ENT" style="display: none" bgcolor="#blue">
  116.             <td style="width: 100px">ENT</td>
  117.             <td style="width: 100px">1.5</td>
  118.             <td style="width: 100px">2.5</td></tr>
  119.         <tr id="FSB" style="display: none" bgcolor="#blue">
  120.             <td style="width: 100px">FSB</td>
  121.             <td style="width: 100px">1.6</td>
  122.             <td style="width: 100px">2.6</td></tr>
  123.        <tr id="GC" style="display: none" bgcolor="#blue">
  124.             <td style="width: 100px">GC</td>
  125.             <td style="width: 100px">1.7</td>
  126.             <td style="width: 100px">2.7</td></tr>
  127.        <tr id="MEM" style="display: none" bgcolor="#blue">
  128.             <td style="width: 100px">MEM</td>
  129.             <td style="width: 100px">1.8</td>
  130.             <td style="width: 100px">2.8</td></tr>
  131.        <tr id="PNC" style="display: none"  bgcolor="#blue">
  132.             <td style="width: 100px">PNC</td>
  133.             <td style="width: 100px">1.9</td>
  134.             <td style="width: 100px">2.9</td></tr>
  135.        <tr id="SDR" style="display: none" bgcolor="#blue">
  136.             <td style="width: 100px">SDR</td>
  137.             <td style="width: 100px">1.10</td>
  138.             <td style="width: 100px">2.10</td></tr>
  139.     </table>
  140.  
  141. </body>
Jan 14 '14 #1
0 1079

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

Similar topics

9
by: Ken | last post by:
How can I reset the initial form variables that are set with session statements when clicking on a button? I tried this but the function was not called: <?PHP function reset_form($none) {...
3
by: Kyle Keller | last post by:
I created a database which my company has used for over 2 years at now over 30 locations. Just today, one of the locations called and was having problems with their program. The database is A97...
6
by: cyoung311 | last post by:
I'm trying to do an automatic update of one table from another through a form. Basically, when a selection is made for an item, in this case a particular workshop, I want to get the associated...
3
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather...
0
by: hykyit | last post by:
Hi, I am currently implementing a part where a trigger will reset a table rows whenever a year has passed since, lets say on July 1st every year.. How can I make this happen? Can i create a...
3
by: cassey14 | last post by:
Hi Guys... Im doing a system and it really make my head ache..i hope somebody help me.. I need to have an id like this "ABCD-07-000001"... I dont know how will I work on that thing.. ABCD...
0
by: Bogdan | last post by:
Hi, I have a table adapter whose main query returns columns from multiple tables. The query calls a stored procedure which uses JOINs (or correlated subqueries - I get the same results in both...
1
by: chinni0719 | last post by:
Hi I have a table values function and i would like to use the function in SSIS package OLEDB Souce select * from . ? I have a input parameter... in parameters i could not give variable I...
0
by: grthilak | last post by:
guys, i m a beginner to this stuff. i want to insert table values in ms access through c# by clicking a button. i saw several sample codes in net, but none of which i can understand clearly. i need...
5
by: visweswaran2830 | last post by:
Hi, I have web page, In that I created table and loaded row values at run_time using javascript. Now I want to take a those table values in aspx.vb coding area, I tried it does not pull up my values...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.