Re: Help please with form field population from a 2nd page
- From: shimmyshack <matt.farey@xxxxxxxxx>
- Date: 29 Apr 2007 17:14:10 -0700
On Apr 29, 9:23 pm, "Richard" <s...@xxxxxxxxxxxxxx> wrote:
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=this.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
.
- Follow-Ups:
- Re: Help please with form field population from a 2nd page
- From: shimmyshack
- Re: Help please with form field population from a 2nd page
- References:
- Help please with form field population from a 2nd page
- From: Richard
- Help please with form field population from a 2nd page
- Prev by Date: FAQ Topic - How do I generate a random integer from 1 to N?
- Next by Date: Re: This small piece of code works in Firefox but not in IE 7... why?
- Previous by thread: Help please with form field population from a 2nd page
- Next by thread: Re: Help please with form field population from a 2nd page
- Index(es):
Relevant Pages
|