Table's row elimination based on option choosen

Table's row elimination based on option choosen

I have a drop down with yes and no option.if i select yes in a table 2 new rows are shown and if i select no another question in row appears but the space occupied by the question of yes option are still appearing in the form which should be eliminated Please help

View Answers

July 7, 2011 at 12:04 PM

Please post your code.


July 7, 2011 at 5:24 PM

<script language="JavaScript" type="text/javascript">
<!-- show hide Working/Surrendered Date
function ShowTB(obj,id1,id2,id3,id4,id5,id6,id7,id8,id9,id10,id11)
{
 txt=obj.options[obj.selectedIndex].text;
 if (txt.match('No'))
 {
  document.getElementById(id1).style.visibility='hidden';
  document.getElementById(id2).style.visibility='hidden';
  document.getElementById(id3).style.visibility='hidden';
  document.getElementById(id4).style.visibility='hidden';
  document.getElementById(id5).style.visibility='hidden';
  document.getElementById(id6).style.visibility='hidden';
  document.getElementById(id7).style.visibility='hidden';
  document.getElementById(id8).style.visibility='hidden';
  document.getElementById(id9).style.visibility='hidden';
  document.getElementById(id10).style.visibility='visible';
  document.getElementById(id11).style.visibility='visible';
 }


 if (txt.match('Yes'))
 {
  document.getElementById(id1).style.visibility='visible';
  document.getElementById(id2).style.visibility='visible';
  document.getElementById(id3).style.visibility='visible';
  document.getElementById(id4).style.visibility='visible';
  document.getElementById(id5).style.visibility='visible';
  document.getElementById(id6).style.visibility='visible';
  document.getElementById(id7).style.visibility='visible';
  document.getElementById(id8).style.visibility='visible';
  document.getElementById(id9).style.visibility='visible';
  document.getElementById(id10).style.visibility='hidden';
  document.getElementById(id11).style.visibility='hidden';
 }
}
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!-- show hide Working/Surrendered Date
function Show(obj,id1,id2,id3)
{
 txt=obj.options[obj.selectedIndex].text;
 if (txt.match('Yes'))
 {
  document.getElementById(id1).style.visibility='hidden';
  document.getElementById(id2).style.visibility='hidden';
  document.getElementById(id3).style.visibility='hidden';
 }


 if (txt.match('No'))
 {
  document.getElementById(id1).style.visibility='visible';
  document.getElementById(id2).style.visibility='visible';
  document.getElementById(id3).style.visibility='visible';
 }
}
//-->
</script>
</head> 
<table>
<tr> 
<td colspan="5"  bgcolor="#990000"  align="center" ><font color="white"></font><B>Network Equipments Availability</B></td> </tr>

<tr align="center" >
<th colspan="2.5"><Font color="Red">*</Font><b>Is there a router available at the site :</b></th>
<th colspan="2.5">
<select name="router" onchange="ShowTB(this,'fred1','fred2','fred3','fred4','fred5','fred6','fred7','fred8','fred9','fred10','fred11');">
<option value="-1">Select</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</th>
</tr>
<tr> 
<th id="fred1" colspan="5"  bgcolor="#990000" style="visibility:hidden;" align="center" ><font color="white"></font><B>Give the following Details</B></th> </tr>

<tr> 

<th id="fred2" align="left" bgcolor="#CCCCCC" style="visibility:hidden;" ><Font color="Red">*</Font><b>Mark</b></th>
<td>
<input id="fred3" style="visibility:hidden;" type="text" name="mark"  size="30"  ></td>

<th id="fred4" align="left" bgcolor="#CCCCCC" style="visibility:hidden;" ><Font color="Red">*</Font><b>Model</b></th>
<td>

<input id="fred5" style="visibility:hidden;" type="text" name="model"  size="30"  ></td>
</tr>

<tr>
<th id="fred6" align="left" bgcolor="#CCCCCC" style="visibility:hidden;" ><Font color="Red">*</Font><b>Sr no</b></th>
<td>
<input id="fred7" style="visibility:hidden;" type="text" name="sr no"  size="30"  ></td>



<th id="fred8" align="left" bgcolor="#CCCCCC" style="visibility:hidden;" ><Font color="Red">*</Font><b>Accesories/Card</b></th>
<td>
<input id="fred9" style="visibility:hidden;" type="text" name="card"  size="30"  ></td>

</tr>



<tr align="center" >
<th id="fred10" align="center" colspan="2.5" bgcolor="#CCCCCC" style="visibility:hidden;" ><Font color="Red">*</Font><b>Does a new Router is required to be processed:</b></th>
<td id="fred11" colspan="2.5" align="left" bgcolor="#CCCCCC" style="visibility:hidden;" >
<select name="info" onchange="Show(this,'fred12','fred13');" >
<option value="-1">Select</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</td>
</tr>

<tr align="center" >
<th id="fred12" align="center" bgcolor="#CCCCCC" colspan="2.5" style="visibility:hidden;" ><Font color="Red">*</Font><b>Is the Router made available from existing stock:</b></th>
<td id="fred13" align="left" bgcolor="#CCCCCC" style="visibility:hidden;"colspan="2.5" >
<select name="stock"  >
<option value="-1">Select</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</td>
</tr>
<tr>

<td  align="center"colspan="2.5" bgcolor="#CCCCCC" text="italic"><Font color="Red">*</Font><b>Any Router Acessories needs to be procured?</b></th> 
<td colspan="2.5">
    <input type="text" name="Acc" size="48" style="background-color:#FFFFCC;">

    </td> 

</tr>
</table>

if i select yes ,then 3 rows appears and occupy the space. if i select no, then question for no appears but the space for 3 row is jst hidden and a long gap appears between the question. plz run the code and see result and plz help me thanks


July 11, 2011 at 2:31 PM

Please give me the solution soon..Its urgent thanks









Related Tutorials/Questions & Answers:
Table's row elimination based on option choosen
Table's row elimination based on option choosen  I have a drop down with yes and no option.if i select yes in a table 2 new rows are shown and if i select no another question in row appears but the space occupied by the question
include a delete option in every row of table in a JSP page
include a delete option in every row of table in a JSP page  I have the following code of a JSP page........... <blockquote> <p>...; <body> <table border="1"> <tr><
Advertisements
delete row from a table in hibernate
delete row from a table in hibernate  is there method to delete row in a table using hibernate like save(-) to insert row
add image in a row of table
add image in a row of table  i have a table in which i have to add image in its row.i am trying to add the image with the help of label i.e i have... jLabel.setIcon(new ImageIcon("E:/2.jpg"));.But when i pass this jlabel in the row it shows
add image in a row of table
add image in a row of table  i have a table in which i have to add image in its row.i am trying to add the image with the help of label i.e i have... jLabel.setIcon(new ImageIcon("E:/2.jpg"));.But when i pass this jlabel in the row it shows
Adding button to each row for the table and adding row to another table
Adding button to each row for the table and adding row to another table  Hi I need to add button to each line in the table(Table data is retrived... row of the table
Hoe to refresh a table row dynamically
Hoe to refresh a table row dynamically  Want to refresh a table data... Friend, Is there a link attribute with every row of a table through which we will able to refresh a particular table row? (adsbygoogle
Table maximum Row count - JDBC
Table maximum Row count  Dear friends I want to select maximum time entry Status from db. for example : Status : 3 4 6 8 3 5 7 5 5 7 5 3 4 5 2 5 1 my output will be 5 means 5 is maximum time
Highlight a corresponding table row - Struts
Highlight a corresponding table row  I have 2 jsps... the table being displayed with rows having links in them(paged display of the table due to huge data) 2.wen klik on the link it leads to Return.jsp 3.now wen
Deleting a Row from SQL Table Using EJB
Deleting a Row from SQL Table Using EJB   ... to delete a row from the SQL Table. Find out the steps given below that describes how to delete a particular row from the database table using EJB. The steps
JavaScript add row dynamically to table
JavaScript add row dynamically to table  ... to add row to a table dynamically then we can also do this with the JavaScript code. In this example we will describe you how to add row dynamically to the table
What?s the maximum size of a row in SQL table?
What?s the maximum size of a row in SQL table?  What?s the maximum size of a row in SQL table?   Hi, The maximum Row Size is 8060 Bytes in a sql table. (adsbygoogle = window.adsbygoogle || []).push
Deleting row and column from a table
Deleting row and column from a table  In this program ,we delete row and column of a table. First we create connection to a database using connection interface and java driver. After it we can delete row using "delete
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  There is a table containing 20 fields and 2 of those are empty. The administrator... into the table. For this all the rows displayed and two rows with empty text boxes, he
Insert specific fields into table dynamically for each row.
Insert specific fields into table dynamically for each row.  There is a table containing 20 fields and 2 of those are empty. The administrator... into the table. For this all the rows displayed and two rows with empty text boxes, he
JavaScript add row to table
JavaScript add row to table      ... will get the table containing the columns Name and Address and a button 'Add row'. On clicking the button, a new row will be added to the table
delete row from a table using hibernate
delete row from a table using hibernate  //code in java file String hql="delete from CONTACT c where ID=6"; Query query=session.createQuery(hql); //error when executing above code CONTACT is not mapped
How to add dropdown list in a row of a sort table applet?
How to add dropdown list in a row of a sort table applet?  How to add dropdown list in a row of a sort table applet
JDBC Delete Row In Table Example
JDBC Delete Row In Table Example : In this tutorial we will learn how delete specific row from the table use mysql JDBC driver.This tutorial defined how one or more specific  row delete from table that follow any given condition
How to search the selected item in row table using radia button in JSP?
How to search the selected item in row table using radia button in JSP?  How to search the selected item in row table using radia button in JSP
Add values of drop down menu( select option) to mysql table
Add values of drop down menu( select option) to mysql table   Here is my code <?php echo $row['valveName'].'<td>'.$row...;option value="ON">ON'; echo '</option>'; echo '<option
Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below
Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below  HI, I have... the table rows up to view more underlying data, then, the table's header (1st row
Query to insert values in the empty fields in the last row of a table in Mysql database?
Query to insert values in the empty fields in the last row of a table in Mysql... row of my MYSQL database. Now I want to fill up those empty fields in the last row. So what will be the query
How to know the selected row from table - JSP-Interview Questions
the selected row in that table.  Hi Friend, Please clarify your...How to know the selected row from table  hi Every one....i am retriving data from database and i place that data into html table.in that table i
show folder on server by clicking a row in table using jsp and ajax
show folder on server by clicking a row in table using jsp and ajax  Hi, i want a jsp page which has one dropdown and one textfield. when i click... display the table. Now if i click on a row it should open a folder in server
show folder on server by clicking a row in table using jsp and ajax
show folder on server by clicking a row in table using jsp and ajax  Hi, i want a jsp page which has one dropdown and one textfield. when i click... display the table. Now if i click on a row it should open a folder in server
Delete a Specific Row from a Database Table
Delete a Specific Row from a Database Table   ... the facility for deleting specific row in a database table. Sometimes, you want... we are going to delete a specific row from the table. If the row get deletes
How to change table row color when click on Hyper Link in jsp?
How to change table row color when click on Hyper Link in jsp?  I use 5 links: Link 1 Link 2 Link 3.. table: row1 row2 row3.. when click on the link1 automatically change
How to identify the radio button id and row id in a table in jsp?
How to identify the radio button id and row id in a table in jsp?   function generateid(no) {var table..."+no; } function addRow(tableID) { var table
Deleting a Row from SQL Table Using EJB
Deleting a Row from SQL Table Using EJB... are going to delete a row from the SQL Table. Find out the steps given below that describes how to delete a particular row from the database table using EJB
How to get table row contents into next jsp page
How to get table row contents into next jsp page  Hi, I have a 30... page.But the problem is how do i get the selected radio button table row... code retrieve data from database and display in the html table. At each row
ModuleNotFoundError: No module named 'double-elimination'
ModuleNotFoundError: No module named 'double-elimination'  Hi, My... named 'double-elimination' How to remove the ModuleNotFoundError: No module named 'double-elimination' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'single-elimination'
ModuleNotFoundError: No module named 'single-elimination'  Hi, My... named 'single-elimination' How to remove the ModuleNotFoundError: No module named 'single-elimination' error? Thanks   Hi, In your
how to display the selected row from the data table in model panel ??
how to display the selected row from the data table in model panel ??  the below displayed is my datatable:tableDatas.xhtml (adsbygoogle = window.adsbygoogle || []).push({}); <rich:dataTable value
getting radio button at start of each row of table - Struts
getting radio button at start of each row of table  i have done the following things, and this is fine for me. But i want radio button at the place... at the start of each row as u saw in above output. So what should i have to do
Delete row and column from table through java code
Delete row and column from table through java code... will see how to delete row and column from given table through java code. Java code...' and a table 'stu_info' in same database. Structure of table 'stu_info
How to Dragging and dropping HTML table row to another position(In Jsp) and save the new position (values) also in database(MySql)?
How to Dragging and dropping HTML table row to another position(In Jsp... have one Html table in jsp page and i am iterating values (in columns of html table)from Database, Now i am Dragging and dropping one HTML table row to another
Dragging and dropping HTML table row to another position(In Jsp) and save the new position (values) also in database
Dragging and dropping HTML table row to another position(In Jsp) and save... table in jsp page and i am iterating values (in columns of html table)from Database, Now i am Dragging and dropping one HTML table row to another position.I
How to Extract row from table view using JSP Code - Java Beginners
How to Extract row from table view using JSP Code  Hi Friends... problem exist with retrival of row from a table on click of link. Table Structure... Email 1 A B C D E F G Update Delete On click of Update, entire row
Modifying a single row of database based on selection in jsp
Modifying a single row of database based on selection in jsp  Hi guys... in a row with s3everal columns, each row having a radio button and a value... or delete the selected row and update to database.. Please provide me a solution
value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.
value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.  <html> <...; <table width="498" height="177" border="0" align="center" cellpadding
Removing a Row from a JTable
the DefaultTableModel that helps us for removing the data of row from a table... Removing a Row from a JTable     ... to remove any one row's data that is wrong entry then you must have to remove from
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
how to display textbox value based on selected option value?
how to display textbox value based on selected option value?  Hi,I have some problem. I use jsp and ajax. first select: 1 second select:2 based... where DOCTOR_ID='"+doctor+"'"); //out.print("<table border='1'>
Mysql Last Row
Mysql Last Row       Mysql Last Row is used to return the last records from table. Understand... in set (0.00 sec) Query to view last row of Table named employee1
table?
table?  Hi, how could i make a table in javascript, which would look like this: AA CODON Number /1000 Fraction .. (this row... to construct a table,with two fixed columns, one that reads and records in the Number
Sql row retrieve - SQL
Sql row retrieve  Sir What are the sql statements so that I can retrieve rows from a table by specifying the row numbers such as row no.5 to 10, row no.13 to 20 like that. thanks Pabitra kr debanth. Guwahati. 
table
table  multiplicatyion table
delete row
into the html table. Along each table row there is a checkbox consists of id of table. When the user selects the particular checkbox, that row will get deleted...delete row  how to delete row using checkbox and button in php

Ads