Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Stan Weiss Newsgroups: comp.lang.javascript Subject: How to Pass variable name to a function Date: Wed, 11 Apr 2012 12:26:22 -0400 Organization: Aioe.org NNTP Server Lines: 24 Message-ID: <4F85B0AE.A1E9FFD8@erols.com> NNTP-Posting-Host: 8p4YCYZc25dk5/DIdgWSVw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.javascript:13335 I have this code in a form which calls the save function. Valve Diameter in Millimetres function save( field, vary, text ) { if( isNaN( field ) ) { alert( text + " is not numeric" ); } else { AInput = eval(field); // this Works vary = eval(field); // this does not workWorks } } Can anyone see what I am doing wrong? Stan