I have combo box which needs to be displayed based on the option i select,
but when i set display none to div it is not getting hidden. what could be the problem.
below is the html code and java script
<div id="addBanks" style="display: none" style="overflow: auto;height: 75%">
<table id="commonBodyTable" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="100%" align="center" class="tableBorder2" border="0" cellpadding="2" cellspacing="0">
<tr>
<td colspan="4" class="mainheader">Add Banks</td>
</tr>
<tr class="darkrow">
<td width="30%" class="textalign">Bank Code</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" ><input type="text" class="textbox" name="bankcode" id="bankcode" maxlength="20" /></td>
</tr>
<tr class="lightrow">
<td width="30%" class="textalign">Bank Name</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" ><input type="text" class="textbox" name="bankname" id="bankname" maxlength="20" /></td>
</tr>
<tr class="darkrow">
<td width="30%" class="textalign">Branch Code</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" ><input type="text" class="textbox" name="branchcode" id="branchcode" maxlength="20" /></td>
</tr>
<tr class="lightrow">
<td width="30%" class="textalign">IFSC Code</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" ><input type="text" class="textbox" name="ifsccode" id="ifsccode" maxlength="20" /></td>
</tr>
<tr class="darkrow">
<td width="30%" class="textalign">Country</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" class="textfieldalign"><select class="combobox" name="countryid" id="countryid" onchange="getStates(this.value)">
<option value="" >- - - Select Country Name - - -</option>
</select></td>
</tr>
<tr class="lightrow">
<td width="30%" class="textalign">State</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" class="textfieldalign"><select class="combobox" name="stateid" id="stateid">
<option value="" >- - - Select State Name - - -</option>
</select></td>
</tr>
<tr class="darkrow">
<td width="30%" class="textalign">District Name</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" >
<select class="combobox" name="districtid" id="districtid">
<option value="" >- - - Select District Name - - -</option>
</select></td>
</tr>
<tr class="lightrow">
<td width="30%" class="textalign">Town or Village</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign">
Town <input type="radio" class="textbox" name="optTownOrVillage" id="optTownOrVillage" value="townOpt" onclick="enableVillageOrTown(this)"/>
Village <input type="radio" class="textbox" name="optTownOrVillage" id="optTownOrVillage" value="villageOpt" onclick="enableVillageOrTown(this)"/>
</td>
</tr>
<div id="villageDiv" style="display: none;">
<tr class="darkrow">
<td width="30%" class="textalign">Village Name</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" >
<select class="combobox" name="villageid" id="villageid">
<option value="" >- - - Select Village Name - - -</option>
</select></td>
</tr>
</div>
<tr class="darkrow">
<div id="townDiv" style="display: none;">
<td width="30%" class="textalign">Town Name</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" >
<select class="combobox" name="townid" id="townid">
<option value="" >- - - Select Town Name - - -</option>
</select></td>
</div>
</tr>
<tr class="darkrow">
<td width="30%" class="textalign"> </td>
<td width="5%" class="mandatory"> </td>
<td width="65%" colspan="2" class="textfieldalign" ><input type="button" class="submitbu" name="save" id="save" value="Save" onclick="saveState()">
<input type="button" class="submitbu" name="cancel" id="cancel" value="Cancel" onclick="cancelAddState();"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
and my java script :
function enableVillageOrTown(opt){
var optionValue = opt.value;
if(optionValue=='townOpt'){
document.getElementById("townDiv").style.display = "";
document.getElementById("villageDiv").style.display = 'none';
}
if(optionValue=='villageOpt'){
document.getElementById("villageDiv").style.display = "";
document.getElementById("townDiv").style.display = 'none';
}
}
UPDATE :
<div id="villageDiv" style="display: none;">
<tr class="darkrow">
<td width="30%" class="textalign">Village Name</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" >
<select class="combobox" name="villageid" id="villageid">
<option value="" >- - - Select Village Name - - -</option>
</select></td>
</tr>
</div>
also this is not properly aligned when
<tr class="lightrow">
<td width="30%" class="textalign">Town or Village</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign">
Town <input type="radio" class="textbox" name="optTownOrVillage" id="optTownOrVillage" value="townOpt" onclick="enableVillageOrTown(this)"/>
Village <input type="radio" class="textbox" name="optTownOrVillage" id="optTownOrVillage" value="villageOpt" onclick="enableVillageOrTown(this)"/>
</td>
</tr>
this is not hidden when the page first time loads
Please help me to find the problem
Regards
Try this code, if it works for you
function enableVillageOrTown(opt){
var optionValue = opt.value;
if(optionValue=='townOpt'){
document.getElementById("townDiv").style.display = "";
document.getElementById("villageDiv").style.display = "none";
}
if(optionValue=='villageOpt'){
document.getElementById("villageDiv").style.display = "";
document.getElementById("townDiv").style.display = "none";
}
}
For that your should use this code for HTML
<!--<div >-->
<tr class="darkrow" id="villageDiv" style="display: none;">
<td width="30%" class="textalign">Village Name</td>
<td width="5%" class="mandatory">*</td>
<td width="65%" colspan="2" class="textfieldalign" >
<select class="combobox" name="villageid" id="villageid">
<option value="" >- - - Select Village Name - - -</option>
</select></td>
</tr>
<!--</div>-->
Remove the DIVs that you are trying to manipulate and just hide or show the TRs that contain the drop downs.
I have tried the code you provided and the results are correct: http://jsfiddle.net/6mKtZ/
...meaning that div id="villageDiv" style="display: none;" is hidden and the only thing that shows up on the page is "?"
Related
I'm trying to hide the second table below and make it appear when customers select the debit option from the drop down menu at the top. I'm relatively new to this so any help is greatly appreciated!
<table width="723" height="75" border="2">
<tbody>
<tr>
<th width="248" scope="col"><span style="font-size: 13px">Payment
Method:</span>
<select>
<option value=""></option>
<option value="tracer ach credit">Credit</option>
<option value="tracer ach debit">Debit</option>
</select> </th>
</tr>
</tbody>
</table>
<br>
<table width="723" height="558" border="2">
<tbody>
<tr style="text-align: center; font-size: 13px;">
<td height="40" colspan="2">
</td>
</tr>
<tr>
<td height="24" valign="top"><span style="font-size: 13px">Bank
Account:</span>
</td>
<td height="26"><textarea rows="1" cols="50">
</textarea> </td>
</td>
<span style="text-align: center">
</div>
</span>
</tr>
</tbody>
</table>
Add id="table2" to your table and this CSS to start hidden:
#table2 {
visibility:hidden;
}
And add to your <select> the onchange="ShowHide(this)" every change in select call the ShowHide function.
With javascript add this function to turn visible the table if the option selected is debit:
function ShowHide(select){
var table2 = document.getElementById("table2");
if(select.value == "tracer ach debit"){
table2.style.visibility="visible";
}else{
table2.style.visibility="hidden";
}
}
Online example:
function ShowHide(select){
var table2 = document.getElementById("table2");
if(select.value == "tracer ach debit"){
table2.style.visibility="visible";
}else{
table2.style.visibility="hidden";
}
}
#table2 {
visibility:hidden;
}
<table width="300" height="75" border="2">
<tbody>
<tr>
<th scope="col">
<span style="font-size: 13px">Payment Method:</span>
<select id="select" onchange="ShowHide(this)">
<option value=""></option>
<option value="tracer ach credit">Credit</option>
<option value="tracer ach debit">Debit</option>
</select>
</th>
</tr>
</tbody>
</table>
<br>
<table width="300" height="300" border="2" id="table2">
<tbody>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td valign="top">
<span style="font-size: 13px">Bank Account:</span>
</td>
<td>
<textarea rows="1" cols="30"></textarea>
<span></span>
</td>
</tr>
</tbody>
</table>
function paymentChangeHandler(event) {
var value = event.target.value;
var bank = document.getElementById("bank_info");
if (value.indexOf('debit') !== -1) {
bank.style.visibility = "visible";
} else {
bank.style.visibility = "hidden";
}
}
var selector = document.getElementById("payment_method");
selector.onchange = paymentChangeHandler;
<table width="723" height="75" border="2">
<tbody>
<tr>
<th width="248" scope="col"><span style="font-size: 13px">Payment
Method:</span>
<select id="payment_method">
<option value=""></option>
<option value="tracer ach credit">Credit</option>
<option value="tracer ach debit">Debit</option>
</select> </th>
</tr>
</tbody>
</table>
<br>
<table width="723" height="558" border="2" id="bank_info" style="visibility:hidden;">
<tbody>
<tr style="text-align: center; font-size: 13px;">
<td height="40" colspan="2">
</td>
</tr>
<tr>
<td height="24" valign="top"><span style="font-size: 13px">Bank
Account:</span>
</td>
<td height="26"><textarea rows="1" cols="50">
</textarea> </td>
<span style="text-align: center">
</span>
</tr>
</tbody>
</table>
Add id's for payment method drop down control and bank table and add style visibility:hidden to bank table.
I'm trying to fix a form and it doesn't seem to be cooperating. It was originally done in HTML tables and because of the old structure of the website I manage (it's an internal only), I'm having a difficult time trying to see where my problem lies.
Issue: There's a form created for Key requests for desks and cabinets, etc. The automated e-mail response after the form fill is coming through with a message to reply to an email dress that is no longer valid. I've updated the HTML version of the form, along with the fields of the form processor and the e-mail is still coming up to say "To approve - reply to : lebarbe#example.org". It should say "To approve - reply to: rolandjordan#example.org".
I've attached copies of the confirmation e-mail, the HTML form, and screenshots of the form processor. Can anyone help me understand what needs to change?
Here's the E-Mailed response that generates to the Department Director:
Received : 1/18/2017 10:48:48 AM
Form : Key and Lock Request Form
Submission ID : 27715
User IP :
______________________
NOTE :
A key and lock request has been made for your department by the person listed below. To approve, you must reply to this email.
Task : Keys Made
Key Number : 1234
Quantity of Keys Needed : 7
Lock Number : 1234
Current Lock Combination :
Location : Marketing
Justification :
Comments : Test - do not process
Requestor Name : Kara Kentner
TM Number : 1234
Title : Webmaster
Department : Marketing
Phone Extension : 7214
Cost Center :
Access Control Request :
Access Area Requested To :
:
FOR KEYS THAT OPEN DEPARTMENTS OR OFFICES :
Key Issued To :
Team Member Number :
:
DIRECTOR INFORMATION :
Director : Kara Kentner
Email : kjkentner#example.org
To approve - reply to : lebarbe#example.org
The last part is what needs changed. The email also comes from the email address lebarbe#example.org and it should come from rolandjorand#example.org. I've updated this section of the HTML form:
<input type="hidden" name="To approve - reply to" value="rolandjordan#example.org">
<html>
<head>
<title>EJGH Team Talk</title>
<meta http-equiv="Content-Type" content="text/html;">
<style type="text/css">
<!--
.heading {font:bold 1.4em Arial,Tahoma,sans-serif; color:#333;}
.title {font:11px Verdana,Tahoma,sans-serif; font-weight:bold; color:#ffffff;}
.text {font:11px Verdana,Tahoma,sans-serif; font-weight:bold; color:#2A6BA5;}
.text:hover { font:11px Verdana,Tahoma,sans-serif; font-weight:bold; color:#2A6BA5; text-decoration: none }
.copytext {font:11px Verdana,Tahoma,sans-serif; font-weight:normal; color:#333;}
-->
</style>
</head>
<body >
<table width="100%" border="0" cellpadding="0" cellspacing="16">
<form name="KeyRequest" method="POST" action="http://teamtalk.net/absolutefp/afp.asp?formid=22">
<tr>
<td valign="top" class="copytext"><table width="100%" border="0">
<tr>
<td width="100%" colspan="4" valign="top" class="copytext"><span class="text">Key and Lock Request Printable Form</span><br>
<span class="text">Note</span>: To save form to your computer, Right click on icon and select <span class="text">Save Target As...</span><br>
<br>
<table width="100%" cellpadding="4" cellspacing="0" style="border: 1px solid #e9e9e9;">
<tr bgcolor="#666666">
<td width="56%" bgcolor="#666666" class="title">Name</td>
<td width="21%" bgcolor="#666666" class="title"><div align="center">Adobe PDF Format</div></td>
</tr>
<tr>
<td class="copytext" width="56%" style="border: 1px solid #e9e9e9;">Key and Lock Request Printable Form</td>
<td class="copytext" width="21%" style="border: 1px solid #e9e9e9;"><div align="center"><img src="images/pdf-logo.gif" width="16" height="16" border="0"></div></td>
</tr>
</table>
<br>
<br>
<span class="text">Key and Lock Request Online Form</span><br>
<span class="text">Note: </span>Fields marked with an asterisk(*) are required.<br>
<input type="hidden" name="NOTE" value="A key and lock request has been made for your department by the person listed below. To approve, you must send your reply to rolandjordan#example.org. ">
</td>
</tr>
<tr>
<td colspan="4" class="text"><table width="100%" cellpadding="4" cellspacing="0" style="border: 1px solid #e9e9e9;">
<tr>
<td colspan="2" bgcolor="#666666" class="title">Task (<strong>Please select all</strong> that apply:) *</td>
</tr>
<tr>
<td width="4%" class="text" style="border: 1px solid #e9e9e9;"><input name="Task" type="checkbox" class="text" value="Keys Made"></td>
<td width="96%" class="text" style="border: 1px solid #e9e9e9;">Keys made</td>
</tr>
<tr>
<td class="text" style="border: 1px solid #e9e9e9;"><input name="Task" type="checkbox" class="text" value="Lock Changed"></td>
<td class="text" style="border: 1px solid #e9e9e9;">Lock changed</td>
</tr>
<tr>
<td class="text" style="border: 1px solid #e9e9e9;"><input name="Task" type="checkbox" class="text" value="Push button lock combination changed"></td>
<td class="text" style="border: 1px solid #e9e9e9;">Push button lock combination changed</td>
</tr>
<tr>
<td class="text" style="border: 1px solid #e9e9e9;"><input name="Task" type="checkbox" class="text" value="Padlock removed"></td>
<td class="text" style="border: 1px solid #e9e9e9;">Padlock removed</td>
</tr>
<tr>
<td class="text" style="border: 1px solid #e9e9e9;"><input name="Task" type="checkbox" class="text" value="Padlock installed"></td>
<td class="text" style="border: 1px solid #e9e9e9;">Padlock installed</td>
</tr>
</table>
<br>
<table width="100%" cellpadding="4" cellspacing="0" style="border: 1px solid #e9e9e9;">
<tr class="title">
<td width="14%" bgcolor="#666666" align="center" class="title">Key #</td>
<td width="13%" bgcolor="#666666" align="center" class="title">Quantity of Keys Needed</td>
<td width="13%" bgcolor="#666666" align="center" class="title">Lock #</td>
<td width="18%" bgcolor="#666666" align="center" class="title">Current Lock Combination</td>
</tr>
<tr>
<td valign="top" class="text" align="center" style="border: 1px solid #e9e9e9;"><input name="Key Number" type="text" class="copytext" id="Key Number" size="8" maxlength="10"></td>
<td valign="top" class="text" style="border: 1px solid #e9e9e9;" align="center">
<select name="Quantity of Keys Needed" class="copytext" id="Quantity of Keys Needed">
<option value="" selected="selected"></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</td>
<td valign="top" class="text" style="border: 1px solid #e9e9e9;" align="center">
<input name="Lock Number" type="text" class="copytext" id="Lock Number" size="8" maxlength="10">
</td>
<td valign="top" class="text" style="border: 1px solid #e9e9e9;" align="center">
<input name="Current Lock Combination" type="text" class="copytext" id="Current Lock Combination" size="12" maxlength="15">
</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="4" class="text"> </td>
</tr>
<tr>
<td class="text"><span class="text">Location: * </span></td>
<td colspan="3" class="text"><input name="Location" type="text" class="copytext" id="Location" size="87" maxlength="200"></td>
</tr>
<tr>
<td class="text">Justification:</td>
<td colspan="3" class="text"><input name="Justification" type="text" class="copytext" id="Justification2" size="30" maxlength="200"></td>
</tr>
<tr>
<td valign="top" class="text">Comments:</td>
<td colspan="3" class="text"><textarea name="Comments" cols="89" rows="6" class="copytext" id="Comments"></textarea></td>
</tr>
<tr>
<td colspan="4" valign="top" class="text"> </td>
</tr>
<tr>
<td nowrap class="text">Requestor Name: *</td>
<td class="text"><input name="Requestor Name" type="text" class="copytext" id="Requestor Name" size="30" maxlength="100"></td>
<td class="text">TM Number: * </td>
<td class="text"><input name="TM Number" type="text" class="copytext" id="TM Number" size="30" maxlength="100"></td>
</tr>
<tr>
<td class="text">Title: *</td>
<td class="text"><input name="Title" type="text" class="copytext" id="Title" size="30" maxlength="100"></td>
<td nowrap class="text">Department: *</td>
<td class="text"><input name="Department" type="text" class="copytext" id="Department" size="30" maxlength="100"></td>
</tr>
<tr>
<td nowrap class="text">Phone Extension: *</td>
<td class="text"><input name="Phone Extension" type="text" class="copytext" id="Phone Extension" size="30" maxlength="15"></td>
<td class="text">Cost Center: </td>
<td class="text"><input name="Cost Center" type="text" class="copytext" id="Cost Center" size="30" maxlength="200"></td>
</tr>
<tr>
<td nowrap class="text">Access Control Request: </td>
<td class="text"><input name="Access Control Request" type="text" class="copytext" id="Access Control Request" size="30" maxlength="200"></td>
<td class="text">Access Area Requested To: </td>
<td class="text"><input name="Access Area Requested To" type="text" class="copytext" id="Access Area Requested To" size="30" maxlength="200"></td>
</tr>
<tr>
<td colspan="4" class="text"> </td>
</tr>
<tr>
<td colspan="4" class="text">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td colspan="2" bgcolor="#666666" class="title"><input type="hidden" name=" "><input type="hidden" name="FOR KEYS THAT OPEN DEPARTMENTS OR OFFICES">For Keys That Open Departments Or Offices (Does not apply to keys for desks, file cabinets, etc.)</td>
</tr>
<tr>
<td width="19%" class="text">Key Issued To (Name): </td>
<td width="81%" class="copytext"><input name="Key Issued To" type="text" class="copytext" size="50" maxlength="100"></td>
</tr>
<tr>
<td class="text">TM Number: </td>
<td class="text"><input name="Team Member Number" type="text" class="copytext" size="50" maxlength="100" id="Team Member Number"></td>
</tr>
<tr>
<td colspan="2" class="copytext"><span style="color: #FF0000"><strong>NOTE:</strong></span> <em>This may be the same person as the requestor. A separate request is required for each individual receiving key(s). Requests for multiple copies of the same key for one person will be denied.</em></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="4" class="text"> </td>
</tr>
<tr>
<td colspan="4" class="text"><table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td colspan="2" bgcolor="#666666" class="title"><input type="hidden" name=" "><input type="hidden" name="DIRECTOR INFORMATION">
Director Information</td>
</tr>
<tr>
<td width="19%" class="text">Dept. Director: *</td>
<td width="81%" class="text"><input name="Director" type="text" class="copytext" size="50" maxlength="100">
<span class="text" style="color: #FF0000">DEPARTMENT DIRECTOR ONLY</span></td>
</tr>
<tr>
<td class="text">Dept. Director Email: *</td>
<td class="text"><input name="Email" type="text" class="copytext" size="50" maxlength="100">
<span class="text" style="color: #FF0000">DEPARTMENT DIRECTOR'S EMAIL ONLY</span>
<input type="hidden" name="To approve - reply to" value="rolandjordan#example.org"></td>
</tr>
<tr>
<td class="text"> </td>
<td class="text"> </td>
</tr>
<tr>
<td colspan="2" class="text" style="color: #FF0000">NOTE: <span class="text" style="color: #FF0000">Request will be emailed to the Department Director first for approval.</span></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="4" class="copytext"> </td>
</tr>
<tr>
<td colspan="4" class="copytext"><p align="left">
<input type="submit" name="Submit" value="Submit" class="copytext">
<input type="reset" name="Reset" value="Reset" class="copytext">
</p></td>
</tr>
</table></td>
</tr>
</form>
</table>
</body>
</html>
However, it still is not coming through correctly. I've also cleared my cache and restarted my browser, just as a last resort. To no avail.
<form action="javascript:goCalc('calcForm')" id="calcForm" name="calcForm">
<table align="center" border="0" cellpadding="3" cellspacing="1" width="100%">
<tbody>
<tr bgcolor="#bfd5ea">
<td style="font-size: 30px; color: f00; FONT-WEIGHT: bold; TEXT-ALIGN: center">
Donation:</td>
<td style="FONT-WEIGHT: bold; TEXT-ALIGN: center">
Tax Rate %:</td>
<td style="FONT-WEIGHT: bold; TEXT-ALIGN: center">
Net Cost of Donation</td>
<td style="FONT-WEIGHT: bold; color: 00f; TEXT-ALIGN: center">
Tax Savings</td>
</tr>
<tr bgcolor="#e6eef7">
<td align="middle" nowrap="nowrap" valign="center">
$
<input class="formtext" name="inputIncome" size="12">x</td>
<td align="middle" bgcolor="#e6eef7" nowrap="nowrap" valign="center">
<select class="formtext" id="inputPercentage" name="inputPercentage">
<option selected="selected" value="10">10%</option>
<option value="15">15%</option>
<option value="25">25%</option>
<option value="28">28%</option>
<option value="33">33%</option>
<option value="35">35%</option>
<option value="39.6">39.6%</option>
</select>=</td>
<td align="middle" valign="center">
$ <span style="FONT-WEIGHT: bold; TEXT-ALIGN: center"> <input class="formtext" id="inputCost" name="inputCost" readonly="readonly" size="12"> </span>
</td>
<td align="middle" valign="center">
$
<input class="formtext" id="inputMoney" name="inputMoney" readonly="readonly" size="12">
</td>
</tr>
<tr align="right">
<td nowrap="nowrap" valign="center">
</td>
<td nowrap="nowrap" valign="center">
<div align="center">
<input class="btn" name="Submit" type="submit" value="Calculate">
</div>
</td>
<td nowrap="nowrap" valign="center">
<div align="center">
</div>
</td>
<td nowrap="nowrap" valign="center">
</td>
</tr>
</tbody>
</table>
</form>
Issue is when user clicks the calculate tab, it does not display the other fields as coded... Tried everything, please help - (2) Readonly lines issue - in lower section of code - only need to display attributes of amount
Have you tried setting the cursor-eventsattribute on an inline css? Say
#inputMoney{
cursor-events: none;
}
or you can also try using the disabled='disabled' property though you have to enable thhose disabled elements before you submit the form
Does "hr" element create new lines similarly like paragraphs elements "p" ? Because I added an "hr" element to my table element and it gives a result like in this image :
EDIT :
<fieldset style="border: solid 1px "><legend>alertes offres/demandes</legend>
<div><img src="http://localhost/bazarmada/pages/img/icons/plus.png" alt="Ajouter un alerte d'abonnement" /></div>
<div style="background-color:#cafbb7;"><b>Marché : </b>Ambalavao</div>
<table width="100%">
<tr>
<td align="center" width="25%">Mardi</td>
<td align="center" width="60%">Akotry</td>
<td align="center" width="5%"><input type="checkbox" value="12" checked onchange="aboDesabo($(this), $(this).val(), 'Akotry');" /></td>
<td align="center" width="5%"><img src="http://localhost/bazarmada/pages/img/icons/edit.png" alt="Modifier" style="height:10px;width:10px;" /></td>
<td align="center" width="5%"><a id="a_del" href="#" onclick="ask(12);"><img src="http://localhost/bazarmada/pages/img/icons/cross.png" alt="Supprimer" style="height:10px;width:10px;" /></a></td>
</tr>
<tr>
<td align="center" width="25%"></td>
<td align="center" width="60%">Akotry gasy</td>
<td align="center" width="5%"><input type="checkbox" value="13" onchange="aboDesabo($(this), $(this).val(), 'Akotry gasy');" /></td>
<td align="center" width="5%"><img src="http://localhost/bazarmada/pages/img/icons/edit.png" alt="Modifier" style="height:10px;width:10px;" /></td>
<td align="center" width="5%"><a id="a_del" href="#" onclick="ask(13);"><img src="http://localhost/bazarmada/pages/img/icons/cross.png" alt="Supprimer" style="height:10px;width:10px;" /></a></td>
</tr>
<tr>
<td align="center" width="25%"></td>
<td align="center" width="60%">Akotry sebota</td>
<td align="center" width="5%"><input type="checkbox" value="14" onchange="aboDesabo($(this), $(this).val(), 'Akotry sebota');" /></td>
<td align="center" width="5%"><img src="http://localhost/bazarmada/pages/img/icons/edit.png" alt="Modifier" style="height:10px;width:10px;" /></td>
<td align="center" width="5%"><a id="a_del" href="#" onclick="ask(14);"><img src="http://localhost/bazarmada/pages/img/icons/cross.png" alt="Supprimer" style="height:10px;width:10px;" /></a></td>
</tr>
<tr>
<td align="center" width="25%"></td>
<td align="center" width="60%">Akotry tsipala</td>
<td align="center" width="5%"><input type="checkbox" value="15" checked onchange="aboDesabo($(this), $(this).val(), 'Akotry tsipala');" /></td>
<td align="center" width="5%"><img src="http://localhost/bazarmada/pages/img/icons/edit.png" alt="Modifier" style="height:10px;width:10px;" /></td>
<td align="center" width="5%"><a id="a_del" href="#" onclick="ask(15);"><img src="http://localhost/bazarmada/pages/img/icons/cross.png" alt="Supprimer" style="height:10px;width:10px;" /></a></td>
</tr>
</table>
<div style="background-color:#cafbb7;"><b>Marché : </b>Merimandroso</div>
<table width="100%">
<tr>
<td align="center" width="25%">Lundi</td>
<td align="center" width="60%">Peta kofehy</td>
<td align="center" width="5%"><input type="checkbox" value="11" checked onchange="aboDesabo($(this), $(this).val(), 'Peta kofehy');" /></td>
<td align="center" width="5%"><img src="http://localhost/bazarmada/pages/img/icons/edit.png" alt="Modifier" style="height:10px;width:10px;" /></td>
<td align="center" width="5%"><a id="a_del" href="#" onclick="ask(11);"><img src="http://localhost/bazarmada/pages/img/icons/cross.png" alt="Supprimer" style="height:10px;width:10px;" /></a></td>
</tr>
<tr><td colspan="5"><hr /></td></tr>
<tr>
<td align="center" width="25%">Jeudi</td>
<td align="center" width="60%">Rary penjy</td>
<td align="center" width="5%"><input type="checkbox" value="19" checked onchange="aboDesabo($(this), $(this).val(), 'Rary penjy');" /></td>
<td align="center" width="5%"><img src="http://localhost/bazarmada/pages/img/icons/edit.png" alt="Modifier" style="height:10px;width:10px;" /></td>
<td align="center" width="5%"><a id="a_del" href="#" onclick="ask(19);"><img src="http://localhost/bazarmada/pages/img/icons/cross.png" alt="Supprimer" style="height:10px;width:10px;" /></a></td>
</tr>
</table>
So how to remove the blank lines above and below the "hr" element ?
Default <hr> tag shows a horizontal line. But in your case there can be a CSS rule which override the default look. Use inspect element and check the matching CSS rule for the hr tag inside the table.
My Test Test
I have this html table where I have one cell in the table with rowSpan = 3. so in the first column, I have 3 rows with inputs and in the second column I have a picture showing to span all 3 columns. I am trying to figure out how the browser figured out how to vertically allocate spacing for each of the rows in the first column.
I want then to be "tight" so all the empty space (if the picture is big, goes to the bottom).
But it seems like the empty space is being allocated across each row equally.
Is there anyway to change this behavior . .
Here is the table:
<table class="input" border="1">
<tbody>
<tr>
<td valign="top">G:</td>
<td valign="top">
<select id="GId" maxlength="50" name="GId">
<option></option>
<option value="2">Joe</option>
<option selected="selected" value="3">Bill</option>
</select>
</td>
<td id="imageBorder" rowspan="3" align="center">
<img class="my_img" src="http://www.example.com/image.png">
</td>
</tr>
<tr>
<td valign="top">Type:</td>
<td valign="top">
<select id="EId" maxlength="50" name="EId">
<option></option>
<option value="10"></option>
<option selected="selected" value="2">A</option>
<option value="4">C</option>
</select>
</td>
</tr>
<tr>
<td valign="top">Manager:</td>
<td valign="top">
<select id="ManagerPersonId" maxlength="50" name="ManagerPersonId">
<option></option>
<option value="204">A</option>
<option value="183">B</option>
</select>
</td>
</tr>
<tr>
<td valign="top">PictureL:</td>
<td colspan="2" valign="top">
<input id="PictureLink" maxlength="200" name="PictureLink" size="60" value="http://www.example.com/image.png" type="text">
</td>
</tr>
</tbody>
</table>
I think you want to have the first 2 rows at minimum height and if the picture is big, all the space to go on the third line. If this is the case, then put a height to the first 2 lines, something like this:
<table class="input" border="1">
<tbody>
<tr>
<td valign="top" height="1">G:</td>
<td valign="top">
<select id="GId" maxlength="50" name="GId">
<option value="2">Joe</option>
<option selected="selected" value="3">Bill</option>
</select>
</td>
<td id="imageBorder" rowspan="3" align="center"><img class="my_img" src="http://www.mysite.com/image.png"> </td>
</tr>
<tr>
<td valign="top" height="1">Type:</td>
<td valign="top">
<select id="EId" maxlength="50" name="EId">
<option value="10"></option>
<option selected="selected" value="2">A</option>
<option value="4">C</option>
</select>
</td>
</tr>
<tr>
<td valign="top">Manager:</td>
<td valign="top">
<select id="ManagerPersonId" maxlength="50" name="ManagerPersonId">
<option value="204">A</option>
<option value="183">B</option>
</select>
</td>
</tr>
<tr>
<td valign="top">PictureL:</td>
<td colspan="2" valign="top"><input id="PictureLink" maxlength="200" name="PictureLink" size="60" value="http://www.mysite.com/image.png" type="text">
</td>
</tr>
</tbody>
</table>
style the td as below to have control on the data alignment.
<table>
<tr>
<td style = "height:300;width:375;vertical-align:top;"> abc </td>
</tr>
</table>
use
<tr valign="top">...</tr>
also your html looks incomplete.
UPDATE
add style="height:100%;" on the first 2 rows so the entire extra height is transferred to the 3rd row.
<table class="input" border="1">
<tbody>
<tr style="height: 100%;">
<td valign="top">G:</td>
<td valign="top"><select id="GId" maxlength="50" name="GId">
<option></option>
<option value="2">Joe</option>
<option selected="selected" value="3">Bill</option>
</select></td>
<td id="imageBorder" rowspan="3" align="center"><img class="my_img" src="http://www.google.co.in/logos/2010/flintstones10-hp.jpg"></td>
</tr>
<tr style="height: 100%;">
<td valign="top">Type:</td>
<td valign="top"><select id="EId" maxlength="50" name="EId">
<option></option>
<option value="10"></option>
<option selected="selected" value="2">A</option>
<option value="4">C</option>
</select></td>
</tr>
<tr>
<td valign="top">Manager:</td>
<td valign="top"><select name="ManagerPersonId" maxlength="50" id="ManagerPersonId">
<option></option>
<option value="204">A</option>
<option value="183">B</option>
</select></td>
</tr>
<tr>
<td valign="top">PictureL:</td>
<td colspan="2" valign="top"><input value="http://www.mysite.com/image.png" size="60" name="PictureLink" maxlength="200" id="PictureLink" type="text"></td>
</tr>
</tbody>
</table>
You can set a fixed height for each row but the last one.
<tr style="height: 20px">
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 20px">
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
This way all the extra space will go to the last row.