Results 1 to 2 of 2
  1. #1

    input numbers only + .

    onkeyup="this.value=this.value.replace(/[^0-9] /g,'')";
    Hi guys, hope you can help me out with this one, I am using the code below to let the user only input numbers, thing is he must be able to add dots as wel like 9.99
    somehow adding the dot and / or escaping it won't work, any ideas?

    onkeyup="this.value=this.value.replace(/[^0-9.] /g,'')";
    onkeyup="this.value=this.value.replace(/[^0-9\.] /g,'')";
    ZCE & Oracle

  2. #2
    maybe should be asking myself any questions anymore.......

    function checkifnumber(valueToCheck)
    valueToCheck= valueToCheck.substr(0,valueToCheck.length-1);
    return valueToCheck;
    return valueToCheck;
    <form name="form1">
    <input type="text" name="name1" onkeyup="this.value=checkifnumber(this.value)" >
    ZCE & Oracle

Posting Permissions

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