Subj : Re: Getting string objects to compare equal To : netscape.public.mozilla.jseng From : Martin Honnen Date : Tue Sep 20 2005 09:31 pm Steve Evans wrote: > Here's a snippet of alas-all-too-common script from a website: > > if (theForm.frmEmail.value != theForm.frmEmailConf.value) { > errAlert("The E-mail addresses entered do not match") > return false > } > > This is comparing two string *objects*, Why is that, if that is client side script and those are form controls then the value property gives you a string value and not a string object. That has always been that way as far as I can remember. Try typeof theForm.frmEmail.value I don't think it gives you 'object', you get 'string' which is a primitive string value. -- Martin Honnen http://JavaScript.FAQTs.com/ .