Click to See Complete Forum and Search --> : newbie question - probably simple form question


Bigjohn
12-04-2003, 08:45 AM
I want a user to fill out a form. I want to pop up a window with that data for validation. On validation (submit) I want that data emailed to me, and 2 values passed to another form.

HELP? Anyone? Please?

Bigjohn
12-04-2003, 05:15 PM
bump! please help.

Bigjohn
12-05-2003, 07:08 AM
another bump! Surely this is a simple thing for you Java gods!

Gollum
12-05-2003, 07:32 AM
Well, since you asked so nicely ;)

What you are asking is quite a lot, so I'll break it up and give you some hints...

1: validate the form data. For this you will need to gather the information from the form. For most <input> tags and the <select> tag, this is as simple as saying document.formName.inputName.value for each field. Next you will need to open a popup window and fill it with HTML so that the user can see what they are agreeing to. Here's a short example:

// gather the data
var n = document.f.someNumber.value;

// create the popup
var w = window.open("", "", "width=300,height=200");

// fill it in
w.document.write("<html><head><title>Validate Now!</title></head>");
w.document.write("<body>You want " + n + ", is that right?<br>");
w.document.write('<button onclick="window.opener.document.f.submit(); window.close();">Please say yes</button>');
w.document.write('</body></html>');
w.document.close();


After that, the process moves on to your server where the server script code then takes the field data, sends you an e-mail and uses two of the values for the next page.

Refer to your server-side scripting manual for details of this (or go to one of the forums; ASP, PHP, etc).

Bigjohn
12-05-2003, 07:50 AM
Originally posted by Gollum
Well, since you asked so nicely ;)

What you are asking is quite a lot, so I'll break it up and give you some hints...

1: validate the form data. For this you will need to gather the information from the form. For most <input> tags and the <select> tag, this is as simple as saying document.formName.inputName.value for each field. Next you will need to open a popup window and fill it with HTML so that the user can see what they are agreeing to. Here's a short example:

// gather the data
var n = document.f.someNumber.value;

// create the popup
var w = window.open("", "", "width=300,height=200");

// fill it in
w.document.write("<html><head><title>Validate Now!</title></head>");
w.document.write("<body>You want " + n + ", is that right?<br>");
w.document.write('<button onclick="window.opener.document.f.submit(); window.close();">Please say yes</button>');
w.document.write('</body></html>');
w.document.close();


After that, the process moves on to your server where the server script code then takes the field data, sends you an e-mail and uses two of the values for the next page.

Refer to your server-side scripting manual for details of this (or go to one of the forums; ASP, PHP, etc).

Hmmm. I think its easier than that even.

Lets say I have a standard HTML form that has the submit button call a script such as yours above. But I want 2 of the values from the first form to be populated into a second form that will be processed when the validate button is clicked. How do I do that?

The second form is also a standard HTML form, and I want to set the values of some of the hidden input strings with values from the first form.

John