Can you not just use "this" ie this.value instead of document.cartyform.myfield.value ??
On 6/3/03 14:57, "Emmet McGovern" <[EMAIL PROTECTED]> wrote: > To clarify my earlier post. This is what I've been trying to no avail > > function CheckCartQty(myField) { > var ErrMsg = ""; > > // Validate that the Quantities in the Cart are > numbers > if ((isNan(document.CartForm.myField.value)) || > (document.CartForm.myField.value == 0)) { > ErrMsg = ErrMsg + "- The Quantity you > entered is invalid\n"; > } > > if (ErrMsg.length > 0) { > window.alert(ErrMsg); > document.CartForm.myField.focus(); > > return false; > } else { > return true; > } > } > > > RE: > > I am calling a function onBlur of a text field... to validate that the > text entered is a number... of course... this list of text fields is > being generated dynamically... (shopping cart quantities). If I pass a > parameter, like so, CheckQty(someFieldName) how do I check that in the > function... Like so, document.CartForm.PARAMETER.value ,it wont let me > use the name of the parameter... do I have to build a string or > something? > > Emmet > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4