function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
guna malliguna malli 

i have one input field in visual page In that inputField I want to enter charecters and Numbers.not use controllers

i have one input field in visual page In that inputField I want to enter characters and Numbers.not use controllers.
but .that is allow decimal values restric that one how??
Prateek Singh SengarPrateek Singh Sengar
You can try a javascript.
  • Create a javascript function like shared below, you might have to tweak it little bit.
  • Call this method onChange of the inputfield.
 
function alphanumeric(inputtxt)  
{  
 var letterNumber = /^[0-9a-zA-Z]+$/;  
 if((inputtxt.value.match(letterNumber))   
  {  
   return true;  
  }  
else  
  {   
   alert("message");   
   return false;   
  }  
  }