473,323 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Parent / Children forms and data

I have an application - an insurance form - which requests personal data on
form one. If the user checks auto or homeowner (or both) on the first form
I need to collect data from each of these (popup?) forms (Auto and HomeOwner
respectively) and then write this collected data to an email message.

Passing selected data to the child forms via the url is possible, but I'm
certain I'd run into a length problem. Since I still have the parent open
then windows.opener.<var>.value is reasonable(??).

Presuming that the user checks both homeowner and auto, after one form is
closed (and we return to the parent) how do I pass this data back to the
parent form?

Session objects (on client side?) appear to be a possible means of passing
data both ways, but I'm not certain from what I've read. Since references
to session variables seems slim - I presume there are better ways. What is
the best <??>, most commonly used way??

When all is said and done - I pass the form to VB ASP script to write the
message (or at least I have done so with several other single page forms).
How do I pass this colloelction of data to something to generate an email
message?

History: I'm an old COBOL / APL / C programmer trying to catch up with the
times, I'm not asking anyone to write code for me - but would surely
appreciate anyone making suggestions and/or pointing me toward appropriate
references.

Thanks //al
Jul 23 '05 #1
4 2057
On Sun, 29 Aug 2004 15:58:35 GMT, Al Jones <al*****@yahoo.com> wrote:
I have an application - an insurance form - which requests personal data
on form one. If the user checks auto or homeowner (or both) on the
first form I need to collect data from each of these (popup?) forms
(Auto and HomeOwner respectively) and then write this collected data to
an email message.
It would be a grave error to make a commerical website dependant upon
pop-ups. Even requested pop-ups are likely to be blocked on some systems,
and the user probably won't realise that they are missing part of the
process.

If the user checks one (or both) of those boxes, the server should
generate an intermediary page that contains the extra fields necessary.
Once they have been filled, the total data set can be passed for final
processing.
Passing selected data to the child forms via the url is possible, but
I'm certain I'd run into a length problem. Since I still have the parent
open then windows.opener.<var>.value is reasonable(??).
window.opener.forms['formName'].elements['elementName'].value

But you shouldn't need to do this, as I described above.
Presuming that the user checks both homeowner and auto, after one form
is closed (and we return to the parent) how do I pass this data back to
the parent form?
One possible way is to get the user to click on a button which writes the
data back, the closes the window. However, what if the user just closes
the window (users do these things)? The data will be lost. An alternative
would be attach change listeners to all the fields that would write the
data back.

The server-side approach is looking more and more appealing...
Session objects (on client side?) appear to be a possible means of
passing data both ways, but I'm not certain from what I've read.
It certainly shouldn't be relied upon. The user can disable cookies.
Cookie data is also limited in size.
Since references to session variables seems slim - I presume there are
better ways. What is the best <??>, most commonly used way??
I would store the data in a database temporarily, giving each user a
unique session id (either stored in a cookie, or in the URL). The
intermediary step I described can add to this data, if necessary.
Alternatively, you could write the data back to intermediary page as
hidden form inputs.

There may well be better approaches, though.
When all is said and done - I pass the form to VB ASP script to write
the message (or at least I have done so with several other single page
forms). How do I pass this colloelction of data to something to generate
an email message?


Most form mail scripts take POST request data and write out the data as
form control name/value pairs. You could either modify such a script to
pull data from the database (if you choose that option), or submit it all
straight to the mail script.

I would say that this question is more appropriate in an ASP group. They
are:

microsoft.public.dotnet.framework.aspnet
microsoft.public.dotnet.framework.aspnet.webservic es
microsoft.public.inetserver.asp.components
microsoft.public.inetserver.asp.db
microsoft.public.inetserver.asp.general

Good luck,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
"Al Jones" <al*****@yahoo.com> skrev i meddelandet
news:L2*******************@news.easynews.com...
I have an application - an insurance form - which requests personal data on form one. If the user checks auto or homeowner (or both) on the first form I need to collect data from each of these (popup?) forms (Auto and HomeOwner respectively) and then write this collected data to an email message.

Passing selected data to the child forms via the url is possible, but I'm
certain I'd run into a length problem. Since I still have the parent open
then windows.opener.<var>.value is reasonable(??).


<snip>

Depending on the browser versions you need to support - how about <span>ing
whatever form elements are required for the homeowner/auto data, and showing
the <span> only if the corresponding checkbox is checked? (by adjusting the
<span>'s style.display/style.visibility)

Joakim Braun
Jul 23 '05 #3

"Joakim Braun" <jo**********@jfbraun.removethis.com> wrote in message
news:ZR*****************@nntpserver.swip.net...
"Al Jones" <al*****@yahoo.com> skrev i meddelandet
news:L2*******************@news.easynews.com...
I have an application - an insurance form - which requests personal data on
form one. If the user checks auto or homeowner (or both) on the first

form
I need to collect data from each of these (popup?) forms (Auto and

HomeOwner
respectively) and then write this collected data to an email message.

Passing selected data to the child forms via the url is possible, but I'm certain I'd run into a length problem. Since I still have the parent open then windows.opener.<var>.value is reasonable(??).


<snip>

Depending on the browser versions you need to support - how about

<span>ing whatever form elements are required for the homeowner/auto data, and showing the <span> only if the corresponding checkbox is checked? (by adjusting the <span>'s style.display/style.visibility)

Joakim Braun

Would you elucidate please....
Jul 23 '05 #4
On Sun, 29 Aug 2004 17:08:50 GMT, Al Jones <al*****@yahoo.com> wrote:

[snip]
Depending on the browser versions you need to support - how about
<span>ing whatever form elements are required for the homeowner/auto
data, and showing the <span> only if the corresponding checkbox is
checked? (by adjusting the <span>'s style.display/style.visibility)

I'd recommend either grouping the elements in a DIV, or hiding the
elements directly. A SPAN just adds bulk.

It also might be a good idea to disable the elements as well as hide them.
If the browser doesn't support the style object, at least it will stop a
user entering values by mistake.
Would you elucidate please....


One of the CSS properties introduced in the second version of the
specification was visibility. It, along with display (introduced in
version one), allows elements to be hidden. With recent browsers, it's
possible to alter the visible state dynamically using the style object.

The difference between an element hidden by visibility and an element
hidden by display, is that the former affects layout; the browser
allocates space but doesn't render the element or its content. The latter
collapses the space used; it's as though the element wasn't there at all.

For example,

<body onload="initialiseForm()">

<!-- other page elements -->

<form ... id="myForm">
<label for="auto">Automobile:
<input id="auto" name="auto" type="checkbox"
onclick="toggleAuto(this.form, this.checked)"></label>
<!-- other form elements -->
<input ... id="myInput">
</form>

<!-- other page elements -->

</body>
function displayElement(o, d) {
if(o.style) {o = o.style;}
o.display = d ? '' : 'none';
}

function initialiseForm() {
var f = document.forms['myForm'];

displayElement(f.elements['myInput'], false);
/* Hide other dependant elements. */
}

function toggleAuto(f, d) {
displayElement(f.elements['myInput'], d);
/* Toggle other elements dependant upon 'auto'. */
}

If you search the archives, you'll find more complete examples.

I admit that I forgot about this when I wrote my first reply. I still
think a server-side solution would be more reliable.

Hope that helps,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ian | last post by:
I have a parent MDI with a menu that calls all the children forms and that works fine. My issue is I created a user control that looks like a toolbar and it has various windows controls on it and...
0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
1
by: clintonG | last post by:
How do I get a TreeNode.Parent property when using the 2.0 TreeView control? When the data source is an XML file there may be redundant names in the tree. For example, when a child node with the...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
0
by: Karthick Kumar | last post by:
Hi, I need to create a simple parent/child hierarchical menu. I have alread used the Treeview control but my requirement is slightly different than the Treeview control. I already have the kind...
4
by: Danny Tuppeny | last post by:
Hi all, I've been trying to write some classes, so when I have a parent-child relationship, such as with Folders in my application, I don't have to remember to add a parent reference, as well as...
2
by: Jim Shank | last post by:
I am really trying to find the best OOP way of doing this. I have a parent MDI form with multiple children and I am trying to communicate variables between them. I have been able to successfully...
6
by: Edwinah63 | last post by:
Hi everyone, could someone give me some thoughts on the best way to manage mdi parent and child forms? in vb6 i could scroll through the forms collection and determine which forms were...
8
by: Rick | last post by:
VS 2005 I' m setting up a parent/child datagridviews in a form. I am doing a lot of this by hand coding in order to get the feel of things. I want a change in the parent table to trigger a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.