Is this possible??

Results 1 to 5 of 5

Thread: Is this possible??

  1. #1
    Big Mac Guest

    Default Is this possible??

    Hi,<BR><BR>I want to have a form that has 3 drop-down-lists with each an action button. I then want to have only ONE asp page to process the request. Is this possible? How would the asp page know which button was pressed? or must I have 3 different asp page for each button.<BR><BR>Thanks

  2. #2
    Ian Stallings Guest

    Default Yes

    You would just need just one asp page<BR>to process the request. You name your drop down menus<BR>like so:<BR><BR>&#060;select name="item1"&#062;<BR>&#060;select name="item2"&#062;<BR>&#060;select name="item3"&#062;<BR><BR><BR>You can then access the data posted from them<BR>in the asp by looking in the request variables<BR>like so:<BR><BR><BR>&#060;%<BR><BR>strItem1 = Request("Item1")<BR>strItem2 = Request("Item3")<BR>strItem2 = Request("Item2")<BR><BR><BR>If strItem1 &#060;&#062; "" Then<BR>&#039do something<BR>End If<BR>%&#062;<BR><BR>I think this would be the easiest apporach.<BR><BR><BR>hope this helps,<BR>e-n Stallings

  3. #3
    Join Date
    Dec 1969

    Default RE: Is this possible??

    Form can have only a single Action. What you could do is have three normal buttons, each of which would call a single javascript function passing the button number.<BR><BR>onclick="GoForm(&#039button1&#039); " <BR><BR>The javascript could then set the value of a hidden field on the form telling what button is pressed...<BR><BR>document.form1.whichbutton.value =&#039button1&#039;<BR><BR>and then submit the form.<BR><BR>document.form1.submit();<BR><BR>Or your could put each drop down in its own form and submit to the same asp, with either a hidden fields or querystring telling which button was pressed.

  4. #4
    Mik eShaffer Guest

    Default RE: Is this possible??

    Yes, it&#039s possible. Give all three submit buttons the same name, but a different &#039value&#039 (e.g. the prompt that shows up inside the button). For example, Let&#039s say you have one form that includes dropdowns for City, State and Country. Each one has a submit button, all named &#039BUTTON1&#039. Your ASP code would then look like:<BR><BR> if request.form("BUTTON1") = "LOOKUP CITY" then<BR> &#039 do lookup city logic<BR> elseif request.form("BUTTON1") = "LOOKUP STATE" then<BR> &#039 do lookup state logic<BR> else<BR> &#039 do lookup country logic<BR> end if<BR><BR><BR><BR>

  5. #5
    Big Mac Guest

    Default Thanks everyone for help

    Thanks to all for your prompt responses. It has helped a lot for the logic.

Posting Permissions

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