how can one form have 2 different actions (really

Results 1 to 3 of 3

Thread: how can one form have 2 different actions (really

  1. #1
    asp junkie Guest

    Default how can one form have 2 different actions (really

    i want to direct the "action" attribute of a form to 2 different asp scripts depending on what the selection of a dropdown box is.<BR>can n e body help.... this has been buggin me all nite....

  2. #2
    Paul Mutton Guest

    Default RE: how can one form have 2 different actions (rea

    Get the form to post to a totally different ASP file that simply redirects the user to the correct page depending on the value sent by the drop-down box.<BR><BR>Easy!<BR><BR>paul_merton@hotmail.com

  3. #3
    Nathen Grass Guest

    Default RE: how can one form have 2 different actions (rea

    You can some use some javascript to do this (As far as I know it only works in IE):<BR><BR>function formRedirect(selectID,formID){<BR>&nbsp;&nbsp;&nbs p;objSelect = document.all(selectID);<BR>&nbsp;&nbsp;&nbsp;objFo rm = document.all(formID);<BR><BR>&nbsp;&nbsp;&nbsp;var sValue = objSelect.options(objSelect.options.selectedIndex) .value;<BR><BR>&nbsp;&nbsp;&nbsp;if(sValue==&#039S omeValueHere&#039){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;objForm.action = &#039Url1Here&#039<BR>&nbsp;&nbsp;&nbsp;}else if(sValue==&#039SomeValueHere&#039){<BR>&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;objForm.action = &#039Url2Here&#039<BR>&nbsp;&nbsp;&nbsp;}<BR><BR>& nbsp;&nbsp;&nbsp;objForm.submit();<BR>}

Posting Permissions

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