input type="text" => action"....

Discussion in 'HTML' started by Georg Ringer, Jun 20, 2005.

  1. Georg Ringer

    Georg Ringer Guest

    Hello,

    how can I get the value of <input type="text" name="textfield"> of my form
    into the action="xxxx"?

    Many thanks in advance
    Georg
    Georg Ringer, Jun 20, 2005
    #1
    1. Advertising

  2. Georg Ringer wrote:

    > how can I get the value of <input type="text" name="textfield"> of my form
    > into the action="xxxx"?


    You don't. You submit the form and let the browser attach it to the query
    string (or POST data). You then have your form handler respond
    appropriately.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Jun 20, 2005
    #2
    1. Advertising

  3. Georg Ringer

    Georg Ringer Guest

    > You don't. You submit the form and let the browser attach it to the query
    > string (or POST data). You then have your form handler respond
    > appropriately.


    Hello David,

    thanks for your fast answer! Can you give me a example how I can do this?

    thanks!
    georg
    Georg Ringer, Jun 20, 2005
    #3
  4. Georg Ringer wrote:

    >> You don't. You submit the form and let the browser attach it to the query
    >> string (or POST data). You then have your form handler respond
    >> appropriately.


    > thanks for your fast answer! Can you give me a example how I can do this?


    From memory, untested:

    package My::package;
    use strict;
    use warnings;
    use Apache::Constants;

    my %dispatch_table = (
    foo => \&foo,
    bar => \&bar
    );

    sub handler {
    my $r = shift;
    my $action = $r->param('action');
    if (defined $dispatch_table{$action}) {
    $dispatch_table{$action}();
    } else {
    error();
    }
    }

    sub foo {
    # Do stuff
    return OK;
    }

    sub bar {
    # Do other stuff
    return OK;
    }

    sub error {
    return HTTP_NOT_FOUND;
    }

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Jun 20, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Bloggs
    Replies:
    1
    Views:
    744
    Sudsy
    Aug 3, 2003
  2. rjweytens
    Replies:
    6
    Views:
    16,081
    rjweytens
    Jun 25, 2004
  3. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,819
    runescience
    Feb 7, 2006
  4. vyshu
    Replies:
    1
    Views:
    2,547
    Richard Senior
    Apr 27, 2007
  5. P E Schoen
    Replies:
    1
    Views:
    1,344
    Gene Wirchenko
    Aug 8, 2012
Loading...

Share This Page