Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2011
    Posts
    136
    Thanks
    101
    Thanked 0 Times in 0 Posts

    Replace button with a link for hidden command

    The below code is working perfectly. I am using a hidden command 'resend' to call the next action within perl.

    Code:
    <form action="$SELF$" method=post>
    <input type=submit value="Send">
    $HIDDENS$
    <input type=hidden name=cmd value=resend><br> 
    </form>
    Is there a way I can replace the button to a link?

    Thank you.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by camaross View Post
    The below code is working perfectly. I am using a hidden command 'resend' to call the next action within perl.

    Code:
    <form action="$SELF$" method=post>
    <input type=submit value="Send">
    $HIDDENS$
    <input type=hidden name=cmd value=resend><br> 
    </form>
    Is there a way I can replace the button to a link?

    Thank you.
    a link will be a GET ot a POST, that means you need to pass the hiddens fields in query string, all of them.
    Something like this:

    <a href="something?cmd=resend&....">go planet</a>

    the dots are for what you have in $HIDDENS$

    best regards

  • Users who have thanked oesxyl for this post:

    camaross (04-15-2011)

  • #3
    Regular Coder
    Join Date
    Jan 2011
    Posts
    136
    Thanks
    101
    Thanked 0 Times in 0 Posts
    Thank you for the reply.

    Quote Originally Posted by oesxyl View Post
    a link will be a GET ot a POST, that means you need to pass the hiddens fields in query string, all of them.
    Something like this:

    <a href="something?cmd=resend&....">go planet</a>

    the dots are for what you have in $HIDDENS$

    best regards

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by camaross View Post
    Thank you for the reply.
    you are welcome, i forget to mention. when you build the query string you need to encode the values. Text values for example can contain chars not allowed in a url.

    best regards

  • Users who have thanked oesxyl for this post:

    camaross (04-16-2011)

  • #5
    New Coder
    Join Date
    Oct 2006
    Posts
    68
    Thanks
    0
    Thanked 28 Times in 28 Posts
    Letting the URI class do the escaping for you:

    Code:
    use URI;
    
    my $uri = URI->new("script.cgi");
    $uri->query_form({cmd => 'resend', hidden => 'val'});
    
    print $uri;

  • Users who have thanked miller for this post:

    camaross (04-16-2011)


  •  

    Posting Permissions

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