Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


swapnali
Table's row elimination based on option choosen
3 Answer(s)      3 years and 4 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


Advertisement
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
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
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
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'>
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
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
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
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
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
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
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
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
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... 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
Advertisements
 

 

 

DMCA.com