Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Show the Slash "/"

    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. "


    how?
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    alert("Please enter valid date with DD/MM/YYYY. ");

  • #3
    New Coder
    Join Date
    Jun 2003
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    backslash maybe?

    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.

    Eric

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    i tried, but i still get error, i cant get what i want!!!
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's the error? and post whatever code you've got so far, and how you called it.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    -27° 28' 22" , 153° 1' 22"
    Posts
    135
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:

    Code:
    alert("Please enter valid date with DD\/MM\/YYYY. ");
    Hope this helps,

    Cheers...
    "Computers are considered female - As soon as you make a commitment to one, you find yourself spending half your paycheck on accessories for it."

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,892
    Thanks
    202
    Thanked 2,528 Times in 2,506 Posts
    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.
    Last edited by Philip M; 06-12-2003 at 07:50 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •