Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
171
rated 0 times [  172] [ 1]  / answers: 1 / hits: 41513  / 13 Years ago, thu, april 28, 2011, 12:00:00
<td><select class=dropDownLists name=reportFlag id=reportFlag tabindex=10 style=WIDTH: 160px onchange='onFocusReportingOptions();'> 
<option value=Select>Select</option>
<option value=Y>Yes</option>
<option value=N>No</option>
</select>
</td>


After I select the option Yes or No, below TD's should be shown or not to the user.



<td id=first_td><select class=dropDownLists name=reportingOption id=reportFlag tabindex=10 style=WIDTH: 160px onchange='callonChange();'> 
<option value=Select>Select</option>
<option value=MyTell>Report via tool</option>
<option value=Manual>Report via manually</option>
</select>
</td>
<td id=second_td><select class=dropDownLists name=acctFlag id=acctFlag tabindex=10 style=WIDTH: 160px onchange='callonChange();'>
<option value=Select>Select</option>
<option value=Y>Yes</option>
<option value=N>No</option>
</select>
</td>


My questions what are the ways to control the display of the td?
one way I can do is with the DIV tags but if we use Div tag i learnt that we need to use table inside the td, in that case then the alignment will be a problem



can any one suggest any other way to get this implemented?


More From » html

 Answers
22

Give the TDs an ID. Then use Javascript to hide the element with the relevant ID (via the CSS display attribute).



<td id=first_td>content</td>
<td id=second_id><content</td>

var elem = document.getElementById(first_td);
elem.style.display = none;


The logic for which TD is hidden or shown can be encapsulated in an event handler for the select drop-down.


[#92511] Wednesday, April 27, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quentinaveryb

Total Points: 102
Total Questions: 100
Total Answers: 93

Location: Colombia
Member since Mon, May 2, 2022
2 Years ago
quentinaveryb questions
Thu, Aug 6, 20, 00:00, 4 Years ago
Fri, Jul 17, 20, 00:00, 4 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;