Posted by Jim Michaels on 02/23/06 10:30
"Otto" <ohaldi@freesurf.ch> wrote in message
news:VA.000003c3.012e2185@freesurf.ch...
> Hello
>
> I saw a form where it was possible to fill a field with a
> few character, then by clicking a button to get a popup
> windows to select a record (according to the filter) and
> then to recover the ID in the form.
>
> Have somebody a sample code ?
> Many thanks in advance for your help.
>
> Otto
>
accessing and setting a text field's contents is basically
document.forms[0].fieldname.value
where fieldname is the name attribute of the form widget.
<input type=text name=fieldname>
popup windows have a problem. everybody now has a popup blocker thanks to
Adobe Acrobat's yahoo toolbar and the google toolbar. so at least you'll
have to notify the user to turn their popup blockers off. Notice I put that
in the plural.
keeping track of a window's variables is pretty easy.
var w=window.open("url","windowname","windowparameters");
you can access that window's form variables with
w.document.forms[0].fieldname.value
because document can be accessed from window.
when you are done with the popup,
w.close();
window.focus(); //probably not necessary, but a good measure just in case.
[Back to original message]
|