Log in

View Full Version : simple variable inclusion question



kusalo
09-09-2006, 07:56 AM
I say 'simple' but oh, what it is to be so close - but not yet arrived. !
So much is about getting the question right. And I have been working on this one for quite a few days now.

So, i have worked out how to pass my variable to the popup.

var VARIABLE = name;

How do I get the VARIABLE into the line:

function put(a,val) { var insert = window.opener.document.EDITFORM.VARIABLE; insert.value += a + val; }

I have tried +, () \'\' and a variety of approaches but can't seem to crack it.

Great would be my delight to have this last leg of the journey resolved.

thanks - arfa

Twey
09-09-2006, 11:46 AM
Huh? It sounds like VARIABLE is a form element from what you're trying to do there. Do you mean the variable contains the name of the form element, like this:
function put(a,val) { var insert = window.opener.document.forms['EDITFORM'].elements[window.opener['VARIABLE']]; insert.value += a + val; }?

kusalo
09-09-2006, 11:38 PM
I think this might be approaching the solution. Several posts on several forums seem to be heading this way.

But... currently it won't work.
I will make up a sample scenario - test it in isolation - and post back.

Many thanks for your help.

kusalo
09-10-2006, 03:20 AM
Yes, right on track.

What I have boiled it down to:

function put(a, val, name) {
window.opener.document.EDITFORM.elements[name].value += (a + val);
}

Thanks for your guidance.

Twey
09-10-2006, 01:05 PM
You mean
window.opener.document.forms.EDITFORM.elements[name].value += (a + val);