Loading ...
Sorry, an error occurred while loading the content.
 

Re: [JavaScript] form that redirects

Expand Messages
  • springer90014
    How would I get the page to redirect based on which submit button the user clicks? The join button should redirect to: join_confirm.html and the remove button
    Message 1 of 6 , Jul 3, 2003
      How would I get the page to redirect based on which submit button the
      user clicks? The join button should redirect to: join_confirm.html
      and the remove button should redirect to: remove_confirm.html

      -springer







      --- In javascript_official@yahoogroups.com, "Dan G. Switzer, II"
      <dswitzer@p...> wrote:
      > Springer,
      >
      > > > I want to create a mailling list form. When the user clicks on
      the
      > > > join button the form will be submitted and the user will be
      > > > redirected to a join confirm page. Or, if the user clicks on
      the
      > > > remove button the form will bwe submitted and they will be
      redirected
      > > > to a remove confirmation page. Does anyone have any
      suggestions?
      >
      > I wouldn't even use JS for this. It seems most people forget that
      if you
      > declare a name/value attribute pair for your submit buttons, you
      can then
      > programmatically determine what button was clicked. For example:
      >
      > <input type="submit" name="userAction" value="Remove" />
      > <input type="submit" name="userAction" value="Add" />
      >
      > On the server side of things, you'll now see a form variable called
      > "userAction" with the value they clicked. The one thing to watch
      out for is
      > if the user hits the [ENTER] key to submit the form--in which case
      the value
      > may not exist (it will if focus was on one of the buttons.) In this
      case,
      > you just need to decide how you want to handle this. (Send them
      back to the
      > back, use "Add" as the default action, etc.)
      >
      > - Dan
      > .......................................
      > : Name: Dan G. Switzer, II :
      > : E-mail: dswitzer@p... :
      > : Blog: http://blog.pengoworks.com/ :
      > :.......................................:
    Your message has been successfully submitted and would be delivered to recipients shortly.
    »
    «