Solved: Question about HTML hyperlinks

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

cearlp

Thread Starter
Joined
Sep 25, 2008
Messages
15
Is there a way to have an anchor tag in the definition of a button?
For example, something like this (which doesn't work by the way)

<td align="center"> <input name="submit" type="submit" value="Update"> <input name="new" type="button" <a href="script.php"></a> value="New Search"></td>

I am trying to show two buttons, looking alike, one to submit the form and the other to bring up a new form. I can't find any documentation the states where and where not an anchor is allowed and there is probably a prescribed way to do what I want, but I haven't found it on my own, so I am turning to the knowledgeable tech out there. Thanks
 
Joined
Mar 23, 2008
Messages
103
Just do this...

HTML:
<form and attributes here><input type="submit" and attributes here></form><form and attributes here><input type="submit" and attributes here></form>
Or just add a javascript onClick function that redirects.


In <head>:
Code:
<script type="text/javascript">
function redirect() {
window.location="URL";
}
</script>
in <body>:
Code:
<input type="button" value="whatever" onClick="redirect()">
 

cearlp

Thread Starter
Joined
Sep 25, 2008
Messages
15
Thanks lumentec,
I tried the two form method you suggested but couldn't get it to work. I was in a table within a form and couldn't get another form to work at the point. I did use your script suggestion and it worked exactly as I wanted. Thanks again!!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top