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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Character Setting in using JS format file

    Code:
    sure.js
    
    function sure(){
    msg = "Are you sure to delete?";
    return confirm(msg);
    }
    
    form.cfm
    
    <script  type="text/javascript" src="sure.js"></script>
    
    <form action="action.cfm" method="post" onSubmit="return sure()" >
    
    <input name="passWord"
               value=""
               type="password"
               size="16"
               maxlength="16"> &nbsp;
    
     
    <input type="submit" value=" Password Submit ">
    
    </form>
    If a user clicks the submit button after he browses form.cfm,
    It will say "Are you sure to delete?

    The above code works fine for that.


    Let's change the above code like the following.
    Code:
    sure.js
    
    function sure(){
    msg = "123456789?";
    return confirm(msg);
    }
    
    form.cfm
    
    <script  type="text/javascript" src="sure.js"></script>
    
    <form action="action.cfm" method="post" onSubmit="return sure()" >
    
    <input name="passWord"
               value=""
               type="password"
               size="16"
               maxlength="16"> &nbsp;
    
     
    <input type="submit" value=" Password Submit ">
    
    </form>
    If a user clicks the submit button after he browses form.cfm,
    It will say "123456789?

    The above code works fine for that.



    Now the following code is my problem.

    Code:
    sure.js
    
    function sure(){
    msg = "Korean Characters?";
    return confirm(msg);
    }
    
    form.cfm
    
    <script  type="text/javascript" src="sure.js"></script>
    
    <form action="action.cfm" method="post" onSubmit="return sure()" >
    
    <input name="passWord"
               value=""
               type="password"
               size="16"
               maxlength="16"> &nbsp;
    
     
    <input type="submit" value=" Password Submit ">
    
    </form>
    If a user clicks the submit button after he browses form.cfm,
    I expect it saying "Korean Characters?

    But the Korean Characters are broken in fact.


    In conclusion,
    English Characters are fine with the above code.
    Numeral Characters are fine with the above code.
    But Korean Characters are not fine with the above code.


    If I make the above two files(surejs and form.cfm) into one file(form.cfm) like the following, it works fine with Korean Characters.

    Code:
    form.cfm
    
    <script type="text/javascript">
    
    function sure(){
    msg = "Are you sure?";
    return confirm(msg);
    }
    
    </script>
    
    <form action="delete.cfm?" method="post" onSubmit="return sure()" >
    
    <input name="passWord"
               value=""
               type="password"
               size="16"
               maxlength="16"> &nbsp;
    
    <input type="submit" value=" Password Submit ">
    
    </form>
    I guess there might be something like Character Setting inside sure.JS or somewhere.

    Although I can make the Korean Characters fine with the just above code,
    I like to know how I set Korean Character in using JS file.

    For example, the following is the Korean Character Setting in every HTML page.
    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
    Last edited by joonstar; 04-16-2005 at 09:17 AM.
    Get my greedy up

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,959
    Thanks
    0
    Thanked 236 Times in 233 Posts
    This will give you an idea.


  •  

    Posting Permissions

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