Form Processing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott

    Form Processing

    Hi,

    I hope someone might be able to set me straight on how to handle the
    situation described below.

    I have a page that has an email field for user input and 2 radio buttons
    (subscribe + unsubscribe) for signing up to a mailing list. What I would
    like to have happen is the following:

    The user enters an email and presses the submit button.

    At this point a new window opens (I would like to be able to specify size,
    etc rather than use _blank) to process the submission and return a response
    (succeeded, already subscribed, etc). The user would then close the window
    by clicking on a 'close' link in the new window.

    I would also like the form data cleared, so the user doesn't think the
    submission didn't work, despite seeing the confirmation window.

    I am using php to process my results. I basically have the above working
    except that I can't seem to clear the form. Anything I have tried results in
    blank results being sent to my form processing program. Any tips?

    Thanks,
    Scott


  • Michael Winter

    #2
    Re: Form Processing

    "Scott" wrote on 13/11/2003:
    [color=blue]
    > Hi,
    >
    > I hope someone might be able to set me straight on how to handle the
    > situation described below.
    >
    > I have a page that has an email field for user input and 2 radio[/color]
    buttons[color=blue]
    > (subscribe + unsubscribe) for signing up to a mailing list. What I[/color]
    would[color=blue]
    > like to have happen is the following:
    >
    > The user enters an email and presses the submit button.
    >
    > At this point a new window opens (I would like to be able to specify[/color]
    size,[color=blue]
    > etc rather than use _blank) to process the submission and return a[/color]
    response[color=blue]
    > (succeeded, already subscribed, etc). The user would then close the[/color]
    window[color=blue]
    > by clicking on a 'close' link in the new window.
    >
    > I would also like the form data cleared, so the user doesn't think[/color]
    the[color=blue]
    > submission didn't work, despite seeing the confirmation window.
    >
    > I am using php to process my results. I basically have the above[/color]
    working[color=blue]
    > except that I can't seem to clear the form. Anything I have tried[/color]
    results in[color=blue]
    > blank results being sent to my form processing program. Any tips?[/color]

    Blank results should only be sent if you cleared the form before it
    was submitted. Using the onload event, wait until the confirmation
    window (CW) has finished loading, then clear the form. As you're
    using JavaScript to open the CW, the opener (window.opener) property
    should be set to the window object of the page that contains your
    form. It would probably look something like:

    <BODY onload="window. opener.document .subscriptionFo rm.email.value =
    '';">

    You can't clear radio buttons, obviously.

    Mike

    --
    Michael Winter
    M.Winter@[no-spam]blueyonder.co.u k (remove [no-spam] to reply)


    Comment

    • Scott

      #3
      Re: Form Processing

      Thanks for the info. Exactly what I needed!!!!

      Scott


      On 11/13/03 6:41 PM, in article
      vEUsb.3449$oe2. 29185126@news-text.cableinet. net, "Michael Winter"
      <M.Winter@[no-spam]blueyonder.co.u k> wrote:
      [color=blue]
      > "Scott" wrote on 13/11/2003:
      >[color=green]
      >> Hi,
      >>
      >> I hope someone might be able to set me straight on how to handle the
      >> situation described below.
      >>
      >> I have a page that has an email field for user input and 2 radio[/color]
      > buttons[color=green]
      >> (subscribe + unsubscribe) for signing up to a mailing list. What I[/color]
      > would[color=green]
      >> like to have happen is the following:
      >>
      >> The user enters an email and presses the submit button.
      >>
      >> At this point a new window opens (I would like to be able to specify[/color]
      > size,[color=green]
      >> etc rather than use _blank) to process the submission and return a[/color]
      > response[color=green]
      >> (succeeded, already subscribed, etc). The user would then close the[/color]
      > window[color=green]
      >> by clicking on a 'close' link in the new window.
      >>
      >> I would also like the form data cleared, so the user doesn't think[/color]
      > the[color=green]
      >> submission didn't work, despite seeing the confirmation window.
      >>
      >> I am using php to process my results. I basically have the above[/color]
      > working[color=green]
      >> except that I can't seem to clear the form. Anything I have tried[/color]
      > results in[color=green]
      >> blank results being sent to my form processing program. Any tips?[/color]
      >
      > Blank results should only be sent if you cleared the form before it
      > was submitted. Using the onload event, wait until the confirmation
      > window (CW) has finished loading, then clear the form. As you're
      > using JavaScript to open the CW, the opener (window.opener) property
      > should be set to the window object of the page that contains your
      > form. It would probably look something like:
      >
      > <BODY onload="window. opener.document .subscriptionFo rm.email.value =
      > '';">
      >
      > You can't clear radio buttons, obviously.
      >
      > Mike[/color]

      Comment

      Working...