By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

Form Processing

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Scott" wrote 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.em ail.value =
'';">

You can't clear radio buttons, obviously.

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)
Jul 20 '05 #2

P: n/a
Thanks for the info. Exactly what I needed!!!!

Scott
On 11/13/03 6:41 PM, in article
vE*********************@news-text.cableinet.net, "Michael Winter"
<M.Winter@[no-spam]blueyonder.co.uk> wrote:
"Scott" wrote 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.em ail.value =
'';">

You can't clear radio buttons, obviously.

Mike


Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.