CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    10

    How do I turn this form button info into just a link

    <FORM name="USERFAVOUR" method="post" action="{$baseurl}/my_favour.php">
    <input type="hidden" name="rvid" value="{$answers[i].VID}">
    <input type="submit" name="removfavour" value="Remove Favorite"> </FORM>

    It is calling on my_favour.php to remove something.

    Please help.
    Thank you.

  2. #2
    Join Date
    May 2004
    Location
    MN / NJ, United States
    Posts
    768

    Re: How do I turn this form button info into just a link

    If you want it to be just a link, simply remove the hidden element, and voila. You'll have to change {$baseurl} to reflect the actual URL you want though, or have that done on the server if you know what you are doing.

    However, if you want a link, a physical anchor is always preferred to a button for accessibility reasons.
    *9-11-01* Never Forget; Never Forgive; Never Relent!
    "If we ever forget that we're one nation under God, then we will be a nation gone under." - Ronald Reagan

  3. #3
    Join Date
    Jul 2007
    Location
    Sweden
    Posts
    331

    Re: How do I turn this form button info into just a link

    As a link, your form would be represented like this:
    Code:
    <a href="{$baseurl}/my_favour.php?rvid={$answers[i].VID}">Remove Favorite</a>
    Note that the method will have changed from POST to GET.

  4. #4
    Join Date
    Nov 2005
    Posts
    49

    Re: How do I turn this form button info into just a link

    it think you can use submit function of form. Consider following code:

    Code:
    <a href="javascript: document.forms['USERFAVOUR'].submit()">Submit</a>
    Muhammad Waqas Badar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured