Home Answers Viewqa JavaScriptQuestions Table's row elimination based on option choosen

 
 


swapnali
Table's row elimination based on option choosen
3 Answer(s)      a year and 10 months ago
Posted in : JavaScript Questions

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 Pages:
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><
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'>
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
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
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
Delete and add row from Table View iPhone
Delete and add row from Table View iPhone In this tutorial will learn how to delete and also how to add row into the table view iPhone, with the help of edit... Based Application so we have to declare the Table view and to insert object
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list without using any button in a table format and one more addtional question
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list without using any button in a table format and one more addtional question
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list without using any button in a table format and one more addtional question
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list without using any button in a table format and one more addtional question
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? Please clarify this. Thanks
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
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. Thanks
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
Mysql Table
. MySQL PHP Query is used to delete the records from the table 'MyTable' based... the records details from the table based on the search condition. The PHP SQL... Rows is used to fetch the select the row value based on the condition specified
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
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.  Here is the code
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
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
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
select option value
select option value  if i select a value of any drop down...' onchange="showState(this.value)"> <option value="none">Select<...;option value="<%=rs.getString(1)%>"><%=rs.getString(2)%><
select option value
select option value  if i select a value of any drop down...(this.value)"> <option value="none">Select</option>...("Select * from country"); while(rs.next()){ %> <option value
table?
table?  Hi, how could i make a table in javascript, which would look like this: AA CODON Number /1000 Fraction .. (this row... can't figure out, how to construct a table,with two fixed columns, one that reads
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 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
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. 
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
Table Maintenance Statements
are creating the table. By using EXTENDED option the table reads row by row... | +--------------+---------+----------+----------+ 1 row in set (0.35 sec) By using ANALYZE TABLE statement we... statement is :    CHECK TABLE tbl_name [, tbl_name] ... [option] ... option
Option Box Value - Java Beginners
Option Box Value  Hi Friends, I have one option box which... option box is populated (work schedule,Peronal Area,personal sub area,business... a table named division(id,divisions) in the database. Hope
jsp drop down-- select Option
dynamically   Hi Friend, Create table country(country_id,country...;nbsp;</td> <select name="sel"><option value=""><---Select... = results.getString(2); String id = results.getString(1); %><option value="<%= name %>
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
form based file upload using servlets
form based file upload using servlets  Hai all, I wrote a program... into database. for that i created a html page having browse option and text box i... file path it uploaded successfully but in database table it gives null value
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... the connection we are going to delete a specific row from the table. If the row
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
delete multiple row using checkbox
delete multiple row using checkbox  how to delete multiple row in a table which is connected to database using checkbox
delete multiple row using checkbox
delete multiple row using checkbox  how to delete multiple row in a table which is connected to database using checkbox
Java: Adding Row in JTable
Java: Adding Row in JTable   how about if we already have the JTAble created earlier. And i just found nothing to get its DefaultTableModel, thus, I... that we need to re-create the table as a whole using AbstractModel, (what
Arraylist from row values
Arraylist from row values  Hello, can anyone please help on how to make an arraylist from the row values of a particular column from a database table? Thanks in advance!   import java.sql.*; import java.util.ArrayList

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.