473,805 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot get child to feed the parent!

Greetings.
I am total newbie to Javascript so what is written below is
probably a bunch of cobblers!! Any assistance in correcting
my code much appreciated.

I wish the popped up child to pass value from the select box
to a text box on the parent form.

Here are my pages (in part)

parent.html

<html><head><ti tle>Parent Page</title></head><body>

<FORM NAME="ListingFo rm">
Use Lookup <input type="text" size="60" name="showValue ">
<br>
<A HREF= "#" onClick="window .open('child1.h tml','Sample',
'toolbar=no,wid th=520,height=5 50,left=10,top= 10, status=no,scrol lbars=no,
resize=no');ret urn false"><font style=FONT-SIZE:8pt>TABLE LOOKUP</A>
</form></body></html>

child1.html

<html><head><ti tle>Child1</title>
<SCRIPT LANGUAGE="Javas cript" TYPE="text/Javascript">

function setvalue(Listin gForm,showValue )

{

var mainpage = window.opener;

parent.ListingF orm.showValue

}

</script></head>

<form>

<select name="Options"
onchange="docum ent.ListingForm .showValue.valu e=this.value">

<option value="">Please select an option</option>

<option value="first option">first option</option>

<option value="second option">second option</option>

<option value="third option">third option</option>

<option value="forth option">fourth option</option>

</select></form>

I have no problem populating the text field on the form if the lookup

table is also part of the same form - but that is not what I need to
achieve.
Apr 30 '07 #1
1 2328
On Apr 30, 11:20 am, "Richard" <s...@justmedal s.comwrote:
Greetings.
I am total newbie to Javascript so what is written below is
probably a bunch of cobblers!! Any assistance in correcting
my code much appreciated.

I wish the popped up child to pass value from the select box
to a text box on the parent form.

Here are my pages (in part)

parent.html

<html><head><ti tle>Parent Page</title></head><body>

<FORM NAME="ListingFo rm">
Use Lookup <input type="text" size="60" name="showValue ">
<br>
<A HREF= "#" onClick="window .open('child1.h tml','Sample',
'toolbar=no,wid th=520,height=5 50,left=10,top= 10, status=no,scrol lbars=no,
resize=no');ret urn false"><font style=FONT-SIZE:8pt>TABLE LOOKUP</A>
</form></body></html>

child1.html

<html><head><ti tle>Child1</title>
<SCRIPT LANGUAGE="Javas cript" TYPE="text/Javascript">

function setvalue(Listin gForm,showValue )

{

var mainpage = window.opener;

parent.ListingF orm.showValue

}

</script></head>

<form>

<select name="Options"
onchange="docum ent.ListingForm .showValue.valu e=this.value">

<option value="">Please select an option</option>

<option value="first option">first option</option>

<option value="second option">second option</option>

<option value="third option">third option</option>

<option value="forth option">fourth option</option>

</select></form>

I have no problem populating the text field on the form if the lookup

table is also part of the same form - but that is not what I need to
achieve.
you should have carried on with the thread " Help please with form
field population from a 2nd page" really.

child1.html ------------------8<------------
<html>
<head>
<title>Child1 </title>
<script type="text/javascript">

function setvalue(select value)
{

var t = window.opener;
var sender = ( !t || t.closed ) ? alert('parent window was closed') :
t;
sender.document .ListingForm.sh owValue.value = selectvalue;

}
</script>
</head>
<body>
<form>
<select name="Options" onchange="setva lue(this.value) ">
<option value="">Please select an option</option>
<option value="first option">first option</option>
<option value="second option">second option</option>
<option value="third option">third option</option>
<option value="forth option">fourth option</option>
</select>
</form>
</body>
</html>
-------------------8<-----------

parent.html-----------------8<----------------
<html>
<head>
<title>Parent Page</title>
</head>
<body>

<form name="ListingFo rm">
Use Lookup
<input type="text" size="60" name="showValue ">
<br>
<A HREF= "#" onClick="var
win=window.open ('child1.html', 'Sample','toolb ar=no,width=520 ,height=550,lef t=10,top=10,
status=no,scrol lbars=no,resize =no');return false">TABLE LOOKUP</A>
</form>
</body>
</html>

try to understnad whats been posted, dont just copy and paste and
leave it at that, what if the pop up appears below the current window?
what if the parent closes and the pop up is left orphaned, how about
focusing back to the parent and closing the pop up when a select is
made, or how about focusing back to the parent but setting the url of
the child to the next select, so it loads in the background and can
just be focused. by using a non standrd way of filling out a simple
form, you are creating usability hurdles for you and your users -
which you can only solve using a scripting language which itself
reduces the audience and legality - unless you provided a straight
forward alternative for those who need it.

by the way, your code is pretty sloppy, copy and paste job mixed with
bad markup, whats the action of the form, what method, why use a popup
to do this when it isnt accessible, the time for 20 selects each with
100 options is negligible compared to an image, so compress your
images properly, and dont overload the form page, and just use a
standard appraoch - like everyone else. Dont try to be the one with
the cunning new method - even its a great method your clients will
still be confused that you do it differently, if they can even access
the pop up - which are mostly blocked these days and are bad practise
anyway.

Apr 30 '07 #2

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

Similar topics

1
9125
by: ahaideb | last post by:
I have a table (relation) in my database: --------------- | parent | child | --------------- | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 | | 3 | 6 |
0
1414
by: GarryFre | last post by:
I've written up this neat screensaver, but it has a few bits of ugliness to it ... 1. I both know how to get the handle for a preview and the handle for the window to display a settings dialog box. I am told to set the settings and preview window as a child of the preview or settings windows given a handle to the parent window either the preview or settings.
4
4573
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 adding to the child collection, eg: parent.Children.Add(child); child.Parent = parent;
5
3545
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I do the update the changed parentid in the child table fails to change. No error is given its just that the change is not written to the Database. When I step through the records for the child table the one I would expect to be changed has a row...
12
10093
by: GRoll35 | last post by:
I get 4 of those errors. in the same spot. I'll show my parent class, child class, and my driver. All that is suppose to happen is the user enters data and it uses parent/child class to display it. here is the 4 errors. c:\C++\Ch15\Employee.h(29): error C2440: '=' : cannot convert from 'char ' to 'char '
4
5046
by: Ryan | last post by:
I've got a little bit of code that runs when you enter data in a datasheet view (which is a subform of the form you are in) if rst!DateReceived >= 30 Then Forms!DisposalRecords.Label90.Caption = (Date - rst!DateReceived) & " Days" however, when that runs to update the caption, it says that it cannot find form DisposalRecords
4
17672
by: active | last post by:
At the statement: FormEdit.ShowDialog() I get the following: Form that is not a top-level form cannot be displayed as a modal dialog box. Remove the form from any parent form before calling showDialog.
5
3139
by: stryfedll | last post by:
Hello, I have installed PHP 5.2, MySQL 5.0, and Apache 2.2. Everything works fine except the error mentioned in the subject. Here is the error log for Apache which shows the problem... Apache/2.2.4 (Win32) PHP/5.2.2 configured -- resuming normal operations Server built: Jan 9 2007 23:17:20 Parent: Created child process 2076 PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext \\php_mysql.dll' - Invalid access...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10607
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10104
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.