1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Question about HTML hyperlinks

Discussion in 'Web Design & Development' started by cearlp, Oct 2, 2008.

Thread Status:
Not open for further replies.
  1. cearlp

    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
     
  2. lumentec

    lumentec

    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()">
     
  3. cearlp

    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!!
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/755474

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice