Hello and welcome to our community! Is this your first visit?
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
    Washington State
    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:


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

    The Captain

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,746 Times in 4,708 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
    London, England
    Thanked 2,573 Times in 2,551 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.

    <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:-

    <html lang="en">
    <title>Numeric Touchscreen</title>
    <style type='text/css'>
    .touch {
    border:1px solid black;
    #touchDiv {text-align:center;}
    <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;
    <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'>
    <form name="myform" action"">
    <input type='text' name="textbox1">
    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 11: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