Form Processing

S

Scott

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
 
M

Michael Winter

on 13/11/2003:
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?

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.subscriptionForm.email.value =
'';">

You can't clear radio buttons, obviously.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top