Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!not-for-mail From: Jake Jarvis Newsgroups: comp.lang.javascript Subject: Re: How to make a multiline alert? Date: Wed, 21 Dec 2011 00:44:43 +0100 Lines: 43 Message-ID: <9lckvcF16aU1@mid.uni-berlin.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 6tVNUmko6XGmN+Y/m2Y+DQu0G69nOQdBQyUgQGfeqaRkWya+4= User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:9478 On 21.12.2011 00:09, Ted Byers wrote: > Here is the beginning of the function: > print "function validateFormData(vtf2) { > var x = vtf2.ccn.value > var msg = \"\"; > var newline = \'CR\'; > if (x==null || x==\"\") { > vtf2.ccn.bgColor=\"lightred\"; > msg.concat(\"\\r\\n\",\"Credit card number must be > provided\"); > } > if (!isNumber(x)) { > msg.concat(\"\\r\\n\",\"Credit card number must be a > number\"); > } > x = vtf2.ccexp.value > if (x==null || x==\"\") { > msg.concat(\"\\r\\n\",\"Credit card expiry date must be > provided\"); > alert(msg); > return false; > } > > I managed to get this function to be executed, but it only displays > the first "Credit card number must be provided", but not the second Please post just the (complete) output source code. > "Credit card expiry date must be provided'. The concatenation looks > like it is working, at least the first time. But what can be the That is impossible for the (incomplete) piece of code you posted, the 'concat' method returns a new string and you never assign again to 'msg'. > problem. Is there a limit t the number of times concat can be called > on a string, or is alert limited in terms of the number of lines of > text it can display? > > Any insights that can be provided would be appreciated. > -- Jake Jarvis