View Full Version : Show the Slash "/"

06-11-2003, 10:51 AM
how to show the Slah ("/") on the alert pop up window??

i want the message show like this : "Please enter valid date with DD/MM/YYYY. "


06-11-2003, 12:59 PM
alert("Please enter valid date with DD/MM/YYYY. ");

06-11-2003, 03:16 PM
I'm not sure if this is what you're doing or not, but it is a common mistkae to use a backslash, which has the '|' on top of it, and the forward slash which has the '?' on top of it. In Javascript and many other languages a backslash is used to denote certain characters. For instance \n is a newline (like hitting enter or using a <br> tag), \t is a tab, \" gives you a " inside of a quotation, etc. If you want to be using a backslash, just do a double one \\ which will give you \ in the displayed text. This is not to be confused with // which is used for comments.


06-12-2003, 06:34 AM
i tried, but i still get error, i cant get what i want!!!

06-12-2003, 06:35 AM
What's the error? and post whatever code you've got so far, and how you called it.

06-12-2003, 07:18 AM
Maybe you have tried this but to use javscript specific characters you need to escape it with a backslash:

Therefore in you're case you would use the following:

alert("Please enter valid date with DD\/MM\/YYYY. ");

Hope this helps,


Philip M
06-12-2003, 07:46 AM
There is no need to escape the / as a literal in an alert box.

alert ('That is not a valid date.\nPlease re-enter [MM/YY]. ');

Here the \n is escaped to make it a newline charcter, not a literal letter n, but you want a literal / (slash). I do not see why your original post does not work.