home
design & development
Lotus application development
print design
web site development
request a design quote
solutions & consulting
Notes and Domino application development
Lotus Domino administration
Securence Mail Filtering
UNITRENDS backup and recovery
Lotus Notes / Domino Apps
free Lotus Notes apps
hosting
web site hosting
Lotus application hosting
check your mail
request a hosting quote
publishing
media and publishing
sound
client services
help & support
Make Payment
Client Access - Workboard
billing & payment policies
copyright & liability policies
pricing & turnaround policies
privacy statement
contact
e-mail MW
get files
send files
Get Field Object / Value Using Field Name via Eval Function
Mindwatering Incorporated
Author: Tripp W Black
Created: 01/10/2006 at 12:58 PM
Category:
Notes Developer Tips
JavaScript
Issue:
The form has a field that contains the name of a field. You want to get the field name and then get the field itself to write a new value to it.
Solution:
var thisfrm;
var openfrm;
var openerSendTo;
// setup forms for this dialog and the form in the originating/parent window
thisfrm = document._FormName;
openerform = window.opener.document._FormName;
// setup working variables
openerSendTo = eval('openerfrm' + thisfrm.tmpSendToFld.value); // tmpSendToFld contains name of field to load
... do some code ...
// update opener SendTo field
openerSendTo.value = thisfrm.tmpSendTo.value
// optionally refresh based on new value
// window.opener._doClick('$Refresh', this, '_self', '#RefreshKW_' + openerSendTo.name)
// close this dialog
self.close();
Second Solution:
Using a hidden flag field, get from that field, the name of a second field.
Using the name get the second field. Looping through [elements] on form isn't an option.
Solution:
Use the Eval. See code sample below.
f=documents.forms[0];
var vfldnm = f.FlagFld.value;
if(vfldnm !="") {
var vfld = eval('f.' + vfldnm);
... do reset of code here ... ;
}
previous page
×