By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,702 Members | 1,771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,702 IT Pros & Developers. It's quick & easy.

Dynamic Value in middle of object reference

P: n/a
HEre is my code

function passVal(p,q,r){
with (window.opener.form1) {
bldr_cmpny.value=p
bldr_cotel.value=q;
bldr_lcse.value=r;
}
window.close();
}

Works great, however, due to bad database design we have 3 differenct
sections of a record and the only difference is instead of "bldr" it is
prefixed with "ownr".

So based on another passed value, lets say "w" I want to indicate a dynamic
value.

I tried eval("window.opener.form1."+w+"_company.value") and I get the right
info when testing in an alert popup, but it doesnt evaluate correctly like
above.

TIA,

Dave
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <TR****************@news.uswest.net>, da********@msn.com
enlightened us with...
Works great, however, due to bad database design we have 3 differenct
sections of a record and the only difference is instead of "bldr" it is
prefixed with "ownr".

So based on another passed value, lets say "w" I want to indicate a dynamic
value.


function passVal(p,q,r,w)
{
// w is either "bldr" or "ownr"
var f = window.opener.form1;
f.elements[w+"_cmpny"].value=p;
f.elements[w+"_cotel"].value=q;
f.elements[w+"_lcse"].value=r;
window.close();
}

-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.