Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #9476

Re: How to make a multiline alert?

From "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Newsgroups comp.lang.javascript
Subject Re: How to make a multiline alert?
Date 2011-12-21 01:42 +0200
Organization A noiseless patient Spider
Message-ID <jcr6gg$iaj$1@dont-email.me> (permalink)
References <c23c39d1-60f1-4155-a08f-df89e4cd36e8@g41g2000yqa.googlegroups.com>

Show all headers | View raw


2011-12-21 1:09, Ted Byers wrote:

> Here is the beginning of the function:
>    print "function validateFormData(vtf2) {

With all due respect (I'm a lifestyle Perlert my self), please note that 
this is a JavaScript group and people here should not be expected to 
know languages like Perl or to be willing to run a Perl interpreter just 
to see the actual JavaScript code generated. Moreover, newsreaders tend 
to break lines and other things.

So please post the generated JavaScript code or, much more preferably, 
the URL of a page that demonstrates the problem in context.

>               msg.concat(\"\\r\\n\",\"Credit card number must be
> provided\");

The invocation msg.concat(...) returns a concatenated string (consisting 
of the value of msg and the argument values). It does not change the 
value of msg, as the above seems to assume.

> I managed to get this function to be executed, but it only displays
> the first "Credit card number must be provided",

That's strange, because it seems that in your code, the value of msg is 
initialized to the empty string and not changed then at all.

To modify the current value of msg by appending the values of a and b to 
it, you could use

msg = msg.concat(a, b)

though I guess people mostly use just

msg += a + b

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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