Solved

unhiding causes misaligned columns

Posted on 2012-03-13
3
358 Views
Last Modified: 2012-03-14
Hi,
The function is triggered when something changes in the email input box.
Why does the new row throw off the the form alignment?

<table width="100%" border="0">
		<tr><td colspan="2">&nbsp;</td></tr>
		<tr>
			<td>&nbsp;</td>
			<td><span style="color:##A00;">*</span> Denotes a required field</td>
		</tr>
		<tr>
			<td align="right"><b>Business Name:</b>&nbsp;</td><td width="77%"></td>
		</tr>
		<tr>
			<td align="right"><b>Account Number:</b>&nbsp;</td><td></td>
		</tr>
		<tr>
			<td align="right"><b><span style="color:##A00;">*</span>Business Phone:</b>&nbsp;</td>
			<td>
				<input type="text" name="txtBusPhone" id="txtBusPhone" value="" onkeyup="disableTabs();" onchange="disableTabs()">
			</td>
		</tr>
		<tr>
			<td align="right"><b>Fax:</b>&nbsp;</td>
			<td>
				<input type="text" name="txtFax" id="txtFax" value="" onkeyup="disableTabs();" onchange="disableTabs();">
			</td>
		</tr>
		<tr>
			<td align="right" valign="middle"><b><span style="color:##A00;">*</span>E-mail:</b>&nbsp;</td>
			<td>
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td valign="top">
							<input type="text" name="txtEmail" id="txtEmail" value="" size="40" validate="regular_expression" pattern="^([_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.(([A-Za-z]{2,3})|(aero|coop|info|museum|name)))?$" message="Email is not valid." onFocus="setWhite(this.id)" onkeyup="" onchange="showConfirm();">			
						</td>
						<td>&nbsp;</td>
						<td valign="top" width="48%" style="font-size:9px;font-weight:bold">Your email is very important to your<br>order. Please confirm its accuracy.</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr id="rowConfirmEmaila" style="visibility:hidden;display:none;">
			<td align="right" valign="middle"><b><span style="color:##A00;">*</span>Confirm E-mail:</b>&nbsp;</td>
			<td>
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td valign="top">
							<input type="text" name="txtEmail" id="txtEmail" value="" size="40" validate="regular_expression" pattern="^([_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.(([A-Za-z]{2,3})|(aero|coop|info|museum|name)))?$" message="Email is not valid." onFocus="setWhite(this.id)" onkeyup="disableTabs();" onchange="disableTabs()">			
						</td>
						<td>&nbsp;</td>
						<td valign="top" width="48%" style="font-size:9px;font-weight:bold"></td>
					</tr>
				</table>
			</td>
		</tr>		
		
		<tr>
			<td align="right"><b>Customer Notes:</b>&nbsp;</td>
			<td>
				<textarea id="txtNotes" name="txtNotes" style="width:300px;" onkeyup="disableTabs();" onchange="disableTabs();"></textarea>
			</td>
		</tr>
	</table>
    
    <script type="text/javascript">

	
	function showConfirm()
	{
		document.getElementById('rowConfirmEmaila').style.visibility = "visible";
			
		document.getElementById('rowConfirmEmaila').style.display = "block";
		
	}
	
</script>

Open in new window

0
Comment
Question by:ecpeel
3 Comments
 
LVL 13

Accepted Solution

by:
haloexpertsexchange earned 250 total points
ID: 37717434
its the display block that is doing it.
try this instead.
function showConfirm()
      {
            document.getElementById('rowConfirmEmaila').style.visibility = "visible";
                  
            document.getElementById('rowConfirmEmaila').style.display = "";
            
      }
0
 
LVL 19

Assisted Solution

by:Albert Van Halen
Albert Van Halen earned 250 total points
ID: 37717622
Loose the inline style visibility: hidden and keep display: none.
Set the style.display to "" (empty string) in showConfirm and it should be OK.
Don't use visibility.
0
 

Author Closing Comment

by:ecpeel
ID: 37719811
Thanks!
and thanks for the extra tip AlbertVanHalen
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Outlook opens HTML email as text 4 24
where is team.js? 3 27
Button and js nou working 3 8
why $(this).attr('id'); function not returning value ? 9 42
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question