Jump to content

Hide / Show row not showing both columns


coupe-r

Recommended Posts

I have a drop down box with 2 values (Rent and Deduction)  If rent is selected, it should show an entire row, but instead, it shows everything in 1 column instead of 2.

 

Please see the screen shot...  Rent Month / Year and its 2 drop downs (month and year) should be in separate columns, much like Payment Type and its drop down.  Any ideas?

 

Here is the JS code:

function showHide(type)
{
if(type == 'Rent')
{
	document.getElementById('trText').style.display = 'inline';
}
	else
	{
		document.getElementById('trText').style.display = 'none';
	}
}

 

Here is my HTML of the table:

<table width="100%" border="0" align="left" cellpadding="2" cellspacing="0" class="tocBorderPayment">
  <tr>
    <td align="right"><strong>Payment Type:</strong></td>
    <td>
<select name="paytype" class="drop" onchange="showHide(this.value)">
<option value="Select">-- Select --</option>
<option value="Rent">Rent</option>
<option value="Deduction">Deduction</option>
</select>
    </td>
  </tr>
  <tr>
    <td align="right"><br /></td>
    <td></td>
  </tr>
  <tr id="trText" style="display:none">
    <td align="right"><strong>Rent Month / Year:</strong></td>
    <td>
      <select name="rent_mon_box" class="drop" id="rent_mon_box">
        <option value="01" <?php if(date("m") == '01') {echo 'selected="selected"';} ?>>January</option>
        <option value="02" <?php if(date("m") == '02') {echo 'selected="selected"';} ?>>February</option>
        <option value="03" <?php if(date("m") == '03') {echo 'selected="selected"';} ?>>March</option>
        <option value="04" <?php if(date("m") == '04') {echo 'selected="selected"';} ?>>April</option>
       <option value="05" <?php if(date("m") == '05') {echo 'selected="selected"';} ?>>May</option>
        <option value="06" <?php if(date("m") == '06') {echo 'selected="selected"';} ?>>June</option>
        <option value="07" <?php if(date("m") == '07') {echo 'selected="selected"';} ?>>July</option>
        <option value="08" <?php if(date("m") == '08') {echo 'selected="selected"';} ?>>August</option>
        <option value="09" <?php if(date("m") == '09') {echo 'selected="selected"';} ?>>September</option>
        <option value="10" <?php if(date("m") == '10') {echo 'selected="selected"';} ?>>October</option>
        <option value="11" <?php if(date("m") == '11') {echo 'selected="selected"';} ?>>November</option>
        <option value="12" <?php if(date("m") == '12') {echo 'selected="selected"';} ?>>December</option>
</select>
    </td>
  </tr>
</table>

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/220084-hide-show-row-not-showing-both-columns/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.