Bhubaneswar, Odisha, India
+91-8328865778
support@softchief.com

CRM JavaScripts Form Validations

CRM JavaScripts Form Validations

Here is some ready made JS function that we can use in our web pages or form.
cropped-creative_wallpaper_modern_man_034276_.jpg
Validate a Mandatory Field

[code language=”css”]
function CheckRequiredFields() {
if (document.getElementById("txtMobile").value== "")
{
alert("Value is Required !");
return false;
}
}
[/code]

Allow Only Numeric Values

[code language=”css”]
function IsNumericKey(e)
{
var inputvalue = window.event.keyCode;
if (inputvalue > 31 && (inputvalue < 48 || inputvalue > 57))
{
alert("Oops !!! I Accept only Numeric values.");
return false;
}
return true;
}
[/code]

E-mail Address Validation
[code language=”css”]
function ValidateEmail() {

var x = document.getElementById("txtEmail").value;

var atposition = x.indexOf("@");

var dotposition = x.lastIndexOf(".");

if (atposition < 1 || dotposition < atposition + 2 || dotposition + 2 >= x.length) {

alert("Not a valid e-mail address");

return false;

}

}
[/code]

Alphabets Only Validation
[code language=”css”]
function ValidateName() {

var letters = /^[A-Za-z]+$/;

if (document.getElementById("txtFName").value.match(letters))
{

return true;

}

else {

alert(‘Oops !!! First Name must have alphabet characters only’);

document.getElementById("txtFName").focus();

return false;

}

}
[/code]

Alpha-Numeric Only Validation
[code language=”css”]
function ValidateAlphaNumeric() {

var pattern = /^[0-9a-zA-Z]+$/;

if (document.getElementById("txtAddress").value.match(pattern))
{

return true;

}

else {

alert(‘Oops !!! Address must have alphanumeric characters only’);

document.getElementById("txtAddress").focus();

return false;

}

}
[/code]

Validate India Mobile Number (10 Digit)
[code language=”css”]
function ValidateIndiaMobileNo() {

var pattern = /^\d{10}$/;

if (document.getElementById("txtIndiaMob").value.match(pattern))
{

return true;

}

else {

alert(‘Oops !!! Not a Valid Indian Mobile Number’);

document.getElementById("txtIndiaMob").focus();

return false;

}

}
[/code]

You can enroll now !We are giving 30% discount on our Internship Program

Don’t miss the chance to participate in the upcoming Internship Program which will be done using Microsoft Dot Net Web Development Full Stack Technology. The new batch will be starting from May 20, 2024.  We will have most experienced trainers for you to successfully complete the internship with live project experience.

Why to choose Our Internship Program?

Industry-Relevant Projects
Tailored Assignments: We offer projects that align with your academic background and career aspirations.
Real-World Challenges: Tackle industry-specific problems and contribute to meaningful projects that make a difference.

Professional Mentorship
Guidance from Experts: Benefit from one-on-one mentorship from seasoned professionals in your field.
Career Development Workshops: Participate in workshops that focus on resume building, interview skills, and career planning.

Networking Opportunities
Connect with Industry Leaders: Build relationships with professionals and expand your professional network.
Peer Interaction: Collaborate with fellow interns and exchange ideas, fostering a supportive and collaborative environment.

Skill Enhancement
Hands-On Experience: Gain practical skills and learn new technologies through project-based learning.
Soft Skills Development: Enhance communication, teamwork, and problem-solving skills essential for career success.

Free Demo Class Available