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

Help please with form field population from a 2nd page

P: n/a
Help please.
I am trying to autofill a form text field from a select-box lookup.
I have no problem doing this if the select-box is part of the form
but because there are 5 possible select boxes for them to choose
from and because of the very large number of options in each
select box, to save form loading time, I want to put the look-up
select boxes on separate (pop-up) pages. (I prefer them not to
be hidden divs on the same page)

Here is the code I have so far:

THE FORM
<FORM NAME="ListingForm" action="path-to-sendmail.cgi" method="post"
onsubmit="CheckForm()">

<input type="text" size="60" name="showValue" style="FONT-SIZE: 8pt; HEIGHT:
12pt">

LOOKUP OPTIONS (Links within the form)

<A HREF= "#" onClick="window.open('Lookup/honours.html','Sample',
'toolbar=no,width=520,height=550,left=10,top=10, status=no,scrollbars=no,
resize=no');return false"><font style=FONT-SIZE:8pt>HONOURS & AWARDS</A>

<A HREF= "#" onClick="window.open('Lookup/decorations.html','Sample',
'toolbar=no,width=520,height=550,left=10,top=10, status=no,scrollbars=no,
resize=no');return false"><font style=FONT-SIZE:8pt>DECORATIONS</A>

(There are three more options)

etc etc submit etc </form>

ONE OF THE POP-UP'S - Lookup/honours.html

<select name="Honours"
onchange="document.ListingForm.showValue.value=thi s.value">

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

<option value="Medal Name 1">Medal Name 1</option>

<option value="Medal Name 2">Medal Name 2</option>

<option value="Medal Name 3">Medal Name 3</option>

<option value="Medal Name 4">Medal Name 4</option></select>

As stated. When the "select box resides in the form, the

text box - 'showValue' populates correctly but it will not do so from

the popped-up page. How can I link the five lookup pages to the form
please???

All help gratefully received
Apr 29 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Apr 29, 9:23 pm, "Richard" <s...@justmedals.comwrote:
Help please.
I am trying to autofill a form text field from a select-box lookup.
I have no problem doing this if the select-box is part of the form
but because there are 5 possible select boxes for them to choose
from and because of the very large number of options in each
select box, to save form loading time, I want to put the look-up
select boxes on separate (pop-up) pages. (I prefer them not to
be hidden divs on the same page)

Here is the code I have so far:

THE FORM
<FORM NAME="ListingForm" action="path-to-sendmail.cgi" method="post"
onsubmit="CheckForm()">

<input type="text" size="60" name="showValue" style="FONT-SIZE: 8pt; HEIGHT:
12pt">

LOOKUP OPTIONS (Links within the form)

<A HREF= "#" onClick="window.open('Lookup/honours.html','Sample',
'toolbar=no,width=520,height=550,left=10,top=10, status=no,scrollbars=no,
resize=no');return false"><font style=FONT-SIZE:8pt>HONOURS & AWARDS</A>

<A HREF= "#" onClick="window.open('Lookup/decorations.html','Sample',
'toolbar=no,width=520,height=550,left=10,top=10, status=no,scrollbars=no,
resize=no');return false"><font style=FONT-SIZE:8pt>DECORATIONS</A>

(There are three more options)

etc etc submit etc </form>

ONE OF THE POP-UP'S - Lookup/honours.html

<select name="Honours"
onchange="document.ListingForm.showValue.value=thi s.value">

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

<option value="Medal Name 1">Medal Name 1</option>

<option value="Medal Name 2">Medal Name 2</option>

<option value="Medal Name 3">Medal Name 3</option>

<option value="Medal Name 4">Medal Name 4</option></select>

As stated. When the "select box resides in the form, the

text box - 'showValue' populates correctly but it will not do so from

the popped-up page. How can I link the five lookup pages to the form
please???

All help gratefully received
you have to tell the popped up window which page opened it, then send
the data there.
so in the pop up

function setvalue(formname,inputname)
{
var mainpage = window.opener;
//now set value of which select you need
mainpage.formname.inputname......
}

so when user clicks the drop down in the pop up, send tha selected
value to the function which sends it on to the input within the form
in the opener

Apr 30 '07 #2

P: n/a
On Apr 30, 1:14 am, shimmyshack <matt.fa...@gmail.comwrote:
On Apr 29, 9:23 pm, "Richard" <s...@justmedals.comwrote:
Help please.
I am trying to autofill a form text field from a select-box lookup.
I have no problem doing this if the select-box is part of the form
but because there are 5 possible select boxes for them to choose
from and because of the very large number of options in each
select box, to save form loading time, I want to put the look-up
select boxes on separate (pop-up) pages. (I prefer them not to
be hidden divs on the same page)
Here is the code I have so far:
THE FORM
<FORM NAME="ListingForm" action="path-to-sendmail.cgi" method="post"
onsubmit="CheckForm()">
<input type="text" size="60" name="showValue" style="FONT-SIZE: 8pt; HEIGHT:
12pt">
LOOKUP OPTIONS (Links within the form)
<A HREF= "#" onClick="window.open('Lookup/honours.html','Sample',
'toolbar=no,width=520,height=550,left=10,top=10, status=no,scrollbars=no,
resize=no');return false"><font style=FONT-SIZE:8pt>HONOURS & AWARDS</A>
<A HREF= "#" onClick="window.open('Lookup/decorations.html','Sample',
'toolbar=no,width=520,height=550,left=10,top=10, status=no,scrollbars=no,
resize=no');return false"><font style=FONT-SIZE:8pt>DECORATIONS</A>
(There are three more options)
etc etc submit etc </form>
ONE OF THE POP-UP'S - Lookup/honours.html
<select name="Honours"
onchange="document.ListingForm.showValue.value=thi s.value">
<option value="">Please select an option</option>
<option value="Medal Name 1">Medal Name 1</option>
<option value="Medal Name 2">Medal Name 2</option>
<option value="Medal Name 3">Medal Name 3</option>
<option value="Medal Name 4">Medal Name 4</option></select>
As stated. When the "select box resides in the form, the
text box - 'showValue' populates correctly but it will not do so from
the popped-up page. How can I link the five lookup pages to the form
please???
All help gratefully received

you have to tell the popped up window which page opened it, then send
the data there.
so in the pop up

function setvalue(formname,inputname)
{
var mainpage = window.opener;
//now set value of which select you need
mainpage.formname.inputname......

}

so when user clicks the drop down in the pop up, send tha selected
value to the function which sends it on to the input within the form
in the opener
further info in post " Cannot get child to feed the parent!" 30th april

Apr 30 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.