Using JS To Convert Text

  1. #1

    Using JS To Convert Text

    Hello,

    I'm using the below JS code to make an uppercase conversion and eliminate some Turkish characters.

    <script type="text/javascript">
     function Upper(e, r) {
      r.value = r.value.toUpperCase();
      r.value = r.value.replace('G', 'G');
      r.value = r.value.replace('Ü', 'U');
      r.value = r.value.replace('S', 'S');
      r.value = r.value.replace('I', 'I');
      r.value = r.value.replace('Ö', 'O');
      r.value = r.value.replace('Ç', 'C');
     }
    </script>
    Using a single text input, I'm able to execute the above javascript code successfully.

    <body>
     <input type="text" id="txtCli" &#111;nkeyup="return Upper(event,this)">
    </body>
    But I can't figure out how I should use this javascript code with Coolite. I've tried something like this but it didn't work.

    <ext:Column DataIndex="ACCESS_GROUP_NAME">
        <Editor>
            <ext:TextField ID="TextField1" runat="server" EnableKeyEvents="true">
                <Listeners>
                    <KeyUp Handler = "return Upper(event,this);" />
                </Listeners>
            </ext:TextField>
        </Editor>
    </ext:Column>
    Your help is very appreciated.
  2. #2

    RE: Using JS To Convert Text

    Hi,
    I am new to coolite so my answer might not be the exactly what you are looking for or should fit in your context.

    r.value = r.value.toUpperCase();
    can be written as
    r.setValue(r.getValue().toUpperCase());

    Regards
    Amar Chaudhary

Similar Threads

  1. Replies: 0
    Last Post: Dec 01, 2011, 6:43 AM
  2. GridPanel convert encrypted text characters
    By ismailkocacan in forum Examples and Extras
    Replies: 1
    Last Post: Nov 04, 2011, 4:42 PM
  3. convert into PDF/DOC
    By ankit in forum 1.x Help
    Replies: 2
    Last Post: Jun 17, 2010, 4:13 PM
  4. Convert 0.7 to 0.8
    By EzaBlade in forum 1.x Help
    Replies: 1
    Last Post: Jul 06, 2009, 11:47 AM
  5. Convert from V# to VB
    By Greg in forum 1.x Help
    Replies: 3
    Last Post: Apr 21, 2009, 1:07 PM

Posting Permissions