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 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2012
    Location
    Washington State
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    A problem I dont know how to solve

    Please Check the webpage to see what I am trying to do. I am told It cant be done in HTML. That I will have to use Java Script. Can someone Please help me out here. Go to:

    http://www.capthelm.net

    If You can assist me please use the email link on my site.
    Thanks.

    The Captain

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,026
    Thanks
    79
    Thanked 4,436 Times in 4,401 Posts
    I don't get it.

    If the only input allowed is to be those 10 buttons, then how would anybody use them to send you a message in the email form? I mean, what good is a message consisting of only digits? You expect them to look up the ASCII equivalents of the letters or something?

    And, no, you can't use <input type="button"> without using JavaScript.

    But in any case, that has to be the ugliest HTML code I have seen in a long time. What is the point of all those <tr> rows that do nothing?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Old Pedant - the touch numbers are supposed to be a password (not sure what it does though). There is a textarea for the actual message at the bottom of the form.


    Code:
    <td align="center"><input value="2" type="button" class=" Keys2" id="myform" target="myform" /></td>     <!-- Col 7 -->
         <td align="center"><input value="3" type="button" class=" Keys2" id="myform" target="password" /></td>   <!-- Col 8 -->
         <td width="20"><input value="4" type="button" class=" Keys2" id="password" target="myform" /></td>   <!-- Col 9 -->
         <td width="20"><input value="5" type="button" class=" Keys2" name="password" /></td>    <!-- Col 10 -->
         <td width="20"><input value="6" type="button" class=" Keys2" name="myform" /></td>      <!-- Col 11 -->
         <td width="20"><input value="7" type="button" class=" Keys2" style="target-myform:" /></td>   <!-- Col 12 -->
         <td width="20"><input value="8" type="button" class=" Keys2" style="target-password:" /></td> <!-- Col 13 -->
         <td width="20"><input value="9" type="button" class=" Keys2" id="password" style="target:myform" /></td>     <!-- Col 14 -->
         <td width="20"><input value="0" type="button" class=" Keys2" id=" " style="display:myform" /></td>   <!-- Col 15 -->
    This seems to have been produced by some sort of generator. I am sorry to say that it is rubbish.

    Try this:-


    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <title>Numeric Touchscreen</title>
    
    <style type='text/css'>
    .touch {
    border:1px solid black;
    font-family:tahoma,sans-serif;
    font-size:15px;
    background-color:#999999;
    color:white;
    width:25px;
    height:25px;
    }
    #touchDiv {text-align:center;}
    </style>
    
    <script type='text/javascript'>
    function addIt(cKey) {
    d = document.forms["myform"].elements["textbox1"];
    d.value =  (cKey.value=='<') ? d.value.slice(0,-1) : d.value+cKey.value;
    }
    </script>
    </head>
    
    <body>
    
    <div id='touchDiv'>
    <input class=touch type=button value=1 onclick="addIt(this)">
    <input class=touch type=button value=2 onclick="addIt(this)">
    <input class=touch type=button value=3 onclick="addIt(this)">
    <input class=touch type=button value=4 onclick="addIt(this)">
    <input class=touch type=button value=5 onclick="addIt(this)">
    <input class=touch type=button value=6 onclick="addIt(this)">
    <input class=touch type=button value=7 onclick="addIt(this)">
    <input class=touch type=button value=8 onclick="addIt(this)">
    <input class=touch type=button value=9 onclick="addIt(this)">
    <input class=touch type=button value=0 onclick="addIt(this)">
    <input class=touch type=button value= " " onclick="addIt(this)">
    
    <input type=button value="<" onclick="addIt(this)" style='width:25px' class='touch'>
    <br><br>
    <form name="myform" action"">
    <input type='text' name="textbox1">
    </form>
    
    </body>
    </html>
    CaptHelm - Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. You can (and should) edit it to make it more meaningful. Change it to "Numeric Touchscreen" or something.


    “A man ceases to be a beginner in any given science and becomes a master in that science when he has
    learned that he is going to be a beginner all his life.” Robin G. Collingwood (English Philosopher, 1889-1943)
    Last edited by Philip M; 02-29-2012 at 10:46 AM. Reason: Improved

    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.


  •  

    Posting Permissions

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