Jump to content

Allow only number entry


Recommended Posts

Add HTML block at the end of your element list or in the footer of your page, click on Source and use the code below

<script>

function isNumberKey(evt){
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;
    return true;
}
document.getElementById('InsertRecordPhone').onkeypress =isNumberKey;
</script>

Replace InsertRecordPhone with actual field ID that you want to only allow numbers

Link to comment
Share on other sites

  • 4 months later...
  • 3 years later...

Hello @Armopankaj,

You may refer to this post https://forums.caspio.com/topic/4377-js-guide-caspio-form-elements/

If you have a Submission form and let`s say the field name is Number, then please use document.getElementById('InsertRecordNumber').

Hope this helps.  Feel free to update this thread if you need any help with the script. 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...