Link to home
Start Free TrialLog in
Avatar of anAppBuilder
anAppBuilderFlag for United States of America

asked on

How do I put an href button to open a site in an email without using javascript?

Putting a line like
<a href='www.somesite.com' target='blank'>
in an HTML email will let the recipient click on the link to open the site in a new browser
.  
Is there a way to do this with a button, rather than the link, without using javasrcript?

Also, is there a way to specify a new tab, rather than a new browser (without using javacript)?
Avatar of focusmultimedia
focusmultimedia
Flag of United Kingdom of Great Britain and Northern Ireland image

You could use:

<form name="form1" method="post" action="http://www.examplexkxkxkxkxk11.com" target="_blank"><input type="submit" name="Submit" value="Click me"></form>

or



-- With the 2nd example, ensure the image has been uploaded to a public webspace and thaty you're not using a local file.
ASKER CERTIFIED SOLUTION
Avatar of focusmultimedia
focusmultimedia
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anAppBuilder

ASKER

Thank you, focusmultimedia.  I tried the first one and it works except that the button is hanging down below the text in onther s in the same .  I tried adding valign='top' to the button, but that doesn't help.  Any ideas?
Avatar of Devario Johnson

<div style="vertical-align:top">
<form name="form1" method="post" action="http://www.examplexkxkxkxkxk11.com" target="_blank"><input type="submit" name="Submit" value="Click me"></form>
</div>

Open in new window

That didn't work either.  Let me do a few experiments then if it's stil not working I'll post a snippet.
Well I can't seem to make it align with the text.  Here's my php snippet .
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<?php
 
 	$site = "http://www.google.com";
 	$test = "<table><tr>
				<td align='left'>Some text</td>
				<td align='left'>&nbsp;Some more text&nbsp;</td>
				<td >&nbsp;&nbsp;
					<div style='vertical-align:top'>
						<form name='form1' method='get' action='$site' target='_blank'>
							<input type='submit' name='submit' value='Click Me'>
						</form>
					</div>
				</td>
			</tr></table>";
 	
 	print $test;
?>

Open in new window

and the page source
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<table><tr>
				<td align='left'>Some text</td>
				<td align='left'>&nbsp;Some more text&nbsp;</td>
				<td >&nbsp;&nbsp;
					<div style='vertical-align:top'>
						<form name='form1' method='get' action='http://www.google.com' target='_blank'>
							<input type='submit' name='submit' value='Click Me'>
						</form>
					</div>
				</td>
			</tr></table>

Open in new window

The vertical positioning of the button is really a separate problem, so I'm going to close this question with thanks to focusmultimedia. I've opened a separate question for the vertical positioning problem.
Thanks!
Thank you, devarioj for the vertical positiong suggestion.  PHope you'll give further suggestions for points in answer to the separate question I posted.
link me to your other question