Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Stan Weiss Newsgroups: comp.lang.javascript Subject: Re: How to Pass variable name to a function Date: Thu, 12 Apr 2012 10:13:55 -0400 Organization: Aioe.org NNTP Server Lines: 49 Message-ID: <4F86E323.AE36EFB4@erols.com> References: <4F85B0AE.A1E9FFD8@erols.com> <4354243.e4iShcapur@PointedEars.de> <4F865E85.F8DBA81B@erols.com> NNTP-Posting-Host: 0LFKx0y469vyintJTg0+6A.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:13352 Stefan Weiss wrote: > > On 2012-04-12 06:48, Stan Weiss wrote: > > Thomas 'PointedEars' Lahn wrote: > >> 1. Your referencing is proprietary, at best error-prone, needlessly. > .. > >> 2. You are referring to an identifier before you declare or define it. > .. > >> 3. You are using eval(). > .. > >> 4. You are using eval() wrong. > .. > >> 5. "Does not work" is not a problem description. > .. > >> 6. You can assign to a function argument, but that does not change the > >> value passed for that argument. > .. > >> 7. The `change' event occurs on the control when the control loses focus, > .. > >> 8. Avoid the window.alert() method. > .. > >> 9. Is your markup Valid? > > > Is this a moderated group? > > Are you the group moderator? > > No and no. > > > I poster enough code to get the answer I needed. While you seem to want > > to make all kinds of ASSumptions about things that were not posted. > > That was actually one of Thomas's more useful replies. Nobody here would > have been surprised if he had answered your question "Can anyone see > what I am doing wrong?" with "Yes" and no further comment. At least you > didn't give him a chance to say "There is no javascript". > > Manners aside, most of his points are valid. Especially: don't use > eval() unless you know exactly what you are doing; do validate the > document before you begin debugging your scripts; stanForm.VD is not a > good way to reference a form element; and don't expect an assignment to > a function parameter to be visible outside the function. These points > really are important for you to understand. The rest will come with time > and practice. > > - stefan Thanks Stefan for the help. Stan