473,372 Members | 923 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,372 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 2059
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.