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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Urgent Help Please: Numerical VirtualPad

    I try to make a numerical virtual pad. The below code is working properly, but the only missing part is the "backspace delete" button. I really appreciate if you help me about this detail, because i have to complete this app. as soon as possible.


    Code:
    <html>
    
    <head>
    <style type="text/css">
    .style11 {
    color: #FFFFFF;
    }
    .style92 {
    font-family: Calibri;
    font-size: small;
    }
    </style>
    
    </head>
    
    <body>
    
    <script language="javascript"> 
    function klavye(veri)
    { document.getElementById('kutucuk').value=kutu=document.getElementById('kutucuk').value + veri
    
    }
    </script>
    
    <center>
    <input type="text" id="kutucuk" readonly="readonly" style="width: 131px; height: 35px">
    
    <span class="style11">
    <input name="1" type="button" value="1" onclick="klavye('1');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="2" type="button" value="2" onclick="klavye('2');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="3" type="button" value="3" onclick="klavye('3');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="4" type="button" value="4" onclick="klavye('4');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="5" type="button" value="5" onclick="klavye('5');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="6" type="button" value="6" onclick="klavye('6');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="7" type="button" value="7" onclick="klavye('7');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="8" type="button" value="8" onclick="klavye('8');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="9" type="button" value="9" onclick="klavye('9');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="0" type="button" value="0" onclick="klavye('0');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    <input name="," type="button" value="," onclick="klavye(',');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />
    
    </span>
    </body>
    </html>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,080
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Try this:=

    Code:
    <script type = "text/javascript">
    
    function klavye(veri) { 
    if (veri !="BS") {
    document.getElementById('kutucuk').value=kutu=document.getElementById('kutucuk').value + veri
    }
    else {
    var len = document.getElementById('kutucuk').value.length;
    document.getElementById('kutucuk').value=document.getElementById('kutucuk').value.substring(0,len-1);
    }
    }
    
    </script>
    
    <input name="BS" type="button" value="BS" onclick="klavye('BS');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />

    “If you only do what you know you can do - then you never do very much.” - Tom Krause

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    matsuka (09-26-2012)

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Philip M,

    Thank you very much for your kind attention. I am at work right now, I'll try your suggestion as soon as I arrive home. I hope it will work.


    Quote Originally Posted by Philip M View Post
    Try this:=

    Code:
    <script type = "text/javascript">
    
    function klavye(veri) { 
    if (veri !="BS") {
    document.getElementById('kutucuk').value=kutu=document.getElementById('kutucuk').value + veri
    }
    else {
    var len = document.getElementById('kutucuk').value.length;
    document.getElementById('kutucuk').value=document.getElementById('kutucuk').value.substring(0,len-1);
    }
    }
    
    </script>
    
    <input name="BS" type="button" value="BS" onclick="klavye('BS');" location.href="#" style="height: 37px; width: 43px; color: #000080; font-weight: bold; background-color: <%=COLOR%>" class="style92" />

    “If you only do what you know you can do - then you never do very much.” - Tom Krause

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,080
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Quote Originally Posted by matsuka View Post
    Philip M,

    Thank you very much for your kind attention. I am at work right now, I'll try your suggestion as soon as I arrive home. I hope it will work.
    Well, it works for me.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Philip M,
    It works perfectly. Thanks a lot. You are great.


  •  

    Posting Permissions

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