467,091 Members | 1,360 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,091 developers. It's quick & easy.

Help please with form field population from a 2nd page

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
  • viewed: 2262
Share:
2 Replies
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
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.

Similar topics

3 posts views Thread by Mike | last post: by
20 posts views Thread by Dj_TRuST | last post: by
5 posts views Thread by aaragon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.