How to allow ghghg ghjggh alphabets, numbers in input devied fdjgkjfg textbox in Javascript

How to allow alphabets numbers in textbox

How to allow alphabets, 7897g numbers in input textbox in Javascript –

djkfhdjf kjidfdf dfko dkfdjfmdf

Input type text box Regex vfgfg alidations for 56756 alphabets, ghghganumeric and emaile in JavaScript, HTtnj, comp

sjhdhgsjhd, bjhshdjshds

dfckjdhfd 45543

  • Example 1 – How to allow onlytgyhtyty alphabets in a input type text box –
<input type="text" oninput="this.value = this.value.replace(/[^a-z A-Z]/g, '').replace(/(\..*)\./g, '$1');" name="studentName" id="studentName">
  • Example 2 – How to allow only numbers in a input type text box –
<input type="text" oninput="this.value = this.value.replace(/[^0-9]/g, '').replace(/(\..*)\./g, '$1');" name="mobileNo" id="mobileNo">
  • Example 3 – How to allow only ghgthh ghghgh alphabets bers in a input type text box –
<input type="text" oninput="this.value = this.value.replace(/[^0-9 a-z A-Z]/g, '').replace(/(\..*)\./g, '$1');" name="IFSC_Code" id="IFSC_Code">
  • Example 4 – How to validate hgjjh gfhghgh in a input type text box –
<input type="text" oninput="this.value = this.value.replace(/[^ . @ _ - 0-9 a-z A-Z]/g, '').replace(/(\*)\./g, '$1');" name="email_id" id="email_id">
Contacts:
Posted by: admin on

2 Comments so far:

  1. Aman says:

    Good sir, plug and play JavaScript validations

  2. Mhd. Danish says:

    Right code for alphabet validation in java script

Leave a Reply to Mhd. Danish Cancel reply

Your email address will not be published. Required fields are marked *