question on form element type 'submit'

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default question on form element type 'submit'

    (using IE/asp/ado)
    I have a few reports that all take the same parameter. I would like to give
    one input box and put 3 buttons next to that one inputbox for selecting
    which report to run on that parameter. I have 2 questions concerning this:

    1) How do I pass to the asp code which button was pressed? I have passed the
    contents of a text input box from the click of a submit button before but
    not a 'value' of a button itself? can I? how to?

    2) Should I have all those buttons just submit to the same asp page or have
    each one go to its own asp page? I know technically I should be able to do
    either but is there a general rule of thumb I should know about?

    Thanks in advance.


    djc Guest

  2. Similar Questions and Discussions

    1. submit form question
      I need the form to submit as soon as the page loads, before they go to another page, and without any interaction from the viewer. Is this...
    2. Form Submit question
      Hi all, I am attempting to create a form that allows single radio selection (in a multiple select) and submitting it to a PERL CGI script. I...
    3. Serialize complex type element with simple content
      Hi, This must be easy, but I can't find an example: I want to automatically serialize an element with an attribute like the following...
    4. #25366 [NEW]: form buttons of type "image" dont send "submit" $_POST variable in IE
      From: jordanolsommer at imap dot cc Operating system: Windows XP PHP version: 4.3.2 PHP Bug Type: Variables related Bug...
    5. Submit Form Question ... please help.
      I tried adding the validation using the "FormCheck". It did not work. Any other ideas? I am very new to HTML ... so if anyone could supply an...
  3. #2

    Default Re: question on form element type 'submit'

    The submit button that was used to submit the form will have its name/value
    pair included in the request's form variables collection (if it's a post) or
    query string (if it's a get). Any other submit elements on the form will
    not have their name/value pairs passed in the request. Let's say you have
    the following form:

    <form method=post>
    <input type=submit name=Rpt1 id=Rpt1 value="Report 1">
    <input type=submit name=Rpt2 id=Rpt2 value="Report 2">
    </form>

    On the server side, you can detect which button was clicked based on the
    name/value pair. e.g.:

    if LenB(Request.Form("Rpt1")) > 0 then
    'report 1 button was clicked
    elseif LenB(Request.Form("Rpt2")) > 0 then
    'report 2 button was clicked
    else
    'neither button was clickeed
    end

    You could also give all the buttons the same name then only check the value
    against this name. However, this isn't a good solution if the UI text might
    change (e.g.: because of localization or other data-driven UI labeling).

    HTH,
    Nicole

    "djc" <noone@nowhere.com> wrote in message
    news:eLwxYIlmDHA.1096@TK2MSFTNGP11.phx.gbl...
    > (using IE/asp/ado)
    > I have a few reports that all take the same parameter. I would like to
    give
    > one input box and put 3 buttons next to that one inputbox for selecting
    > which report to run on that parameter. I have 2 questions concerning this:
    >
    > 1) How do I pass to the asp code which button was pressed? I have passed
    the
    > contents of a text input box from the click of a submit button before but
    > not a 'value' of a button itself? can I? how to?
    >
    > 2) Should I have all those buttons just submit to the same asp page or
    have
    > each one go to its own asp page? I know technically I should be able to do
    > either but is there a general rule of thumb I should know about?
    >
    > Thanks in advance.
    >
    >

    Nicole Calinoiu Guest

  4. #3

    Default Re: question on form element type 'submit'

    Thanks!

    "Nicole Calinoiu" <nicolec@somewhere.net> wrote in message
    news:uSLGtjJnDHA.1672@TK2MSFTNGP09.phx.gbl...
    > The submit button that was used to submit the form will have its
    name/value
    > pair included in the request's form variables collection (if it's a post)
    or
    > query string (if it's a get). Any other submit elements on the form will
    > not have their name/value pairs passed in the request. Let's say you have
    > the following form:
    >
    > <form method=post>
    > <input type=submit name=Rpt1 id=Rpt1 value="Report 1">
    > <input type=submit name=Rpt2 id=Rpt2 value="Report 2">
    > </form>
    >
    > On the server side, you can detect which button was clicked based on the
    > name/value pair. e.g.:
    >
    > if LenB(Request.Form("Rpt1")) > 0 then
    > 'report 1 button was clicked
    > elseif LenB(Request.Form("Rpt2")) > 0 then
    > 'report 2 button was clicked
    > else
    > 'neither button was clickeed
    > end
    >
    > You could also give all the buttons the same name then only check the
    value
    > against this name. However, this isn't a good solution if the UI text
    might
    > change (e.g.: because of localization or other data-driven UI labeling).
    >
    > HTH,
    > Nicole
    >
    > "djc" <noone@nowhere.com> wrote in message
    > news:eLwxYIlmDHA.1096@TK2MSFTNGP11.phx.gbl...
    > > (using IE/asp/ado)
    > > I have a few reports that all take the same parameter. I would like to
    > give
    > > one input box and put 3 buttons next to that one inputbox for selecting
    > > which report to run on that parameter. I have 2 questions concerning
    this:
    > >
    > > 1) How do I pass to the asp code which button was pressed? I have passed
    > the
    > > contents of a text input box from the click of a submit button before
    but
    > > not a 'value' of a button itself? can I? how to?
    > >
    > > 2) Should I have all those buttons just submit to the same asp page or
    > have
    > > each one go to its own asp page? I know technically I should be able to
    do
    > > either but is there a general rule of thumb I should know about?
    > >
    > > Thanks in advance.
    > >
    > >
    >
    >

    djc Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139