Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #9478
| 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 <pig_in_shoes@yahoo.com> |
| 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> (permalink) |
| References | <c23c39d1-60f1-4155-a08f-df89e4cd36e8@g41g2000yqa.googlegroups.com> |
| 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 | <c23c39d1-60f1-4155-a08f-df89e4cd36e8@g41g2000yqa.googlegroups.com> |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.javascript:9478 |
Show key headers only | View raw
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
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
How to make a multiline alert? Ted Byers <r.ted.byers@gmail.com> - 2011-12-20 15:09 -0800 Re: How to make a multiline alert? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2011-12-21 01:42 +0200 Re: How to make a multiline alert? Gene Wirchenko <genew@ocis.net> - 2011-12-20 15:43 -0800 Re: How to make a multiline alert? Jake Jarvis <pig_in_shoes@yahoo.com> - 2011-12-21 00:44 +0100
csiph-web