Skip to content

Commit 54a32a1

Browse files
authored
PAN Number Validation (#1454)
* readme.md * fieldplaceholder.js * readme.md * PAN Validation.js
1 parent 84fefd6 commit 54a32a1

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
2+
if (isLoading || newValue === '') {
3+
return;
4+
}
5+
var panNumber = g_form.getValue("pan_number"); //Get the PAN card information
6+
var panRegex = /^[A-Z]{5}[0-9]{4}[A-Z]{1}$/; // Regex for the PAN Card
7+
8+
if (panRegex.test(panNumber)) {
9+
g_form.showFieldMsg("pan_number", "Valid PAN card number.", true); //Valid PAN card enterd populates this message
10+
} else {
11+
g_form.showErrorBox("pan_number", "InValid PAN card number.", true); //In Valid PAN card details enterd populate this message
12+
}
13+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
PAN is a ten-digit unique alphanumeric number issued by the Income Tax Department.
2+
Indian PAN (Permanent Account Number) card based on its standardized format.
3+
A PAN number is a unique 10-character alphanumeric identifier issued by the Indian government, and it follows a specific structure:
4+
First 5 characters: Uppercase English letters (A-Z).
5+
Next 4 characters: Numeric digits (0-9).
6+
Last character: A single uppercase English letter (A-Z).
7+
![image](https://github.com/user-attachments/assets/37a6490b-912e-499c-9c41-c0cdf79491a5)
8+
9+
When we provide the information in the mentioned format it validates as a valid PAN Card
10+
Eg: ABCDE1234F
11+
Result
12+
![image](https://github.com/user-attachments/assets/779757b9-2d46-439b-bc8c-a468a5c0264a)
13+
14+
Mentioned formate was not used it will give an error message to the field
15+
Eg:abcde1234f
16+
![image](https://github.com/user-attachments/assets/1dd214b8-aaf5-405d-aefb-8e46b786be3c)
17+
18+
Eg: 1234ABCDEF
19+
![image](https://github.com/user-attachments/assets/08f538b7-d1ac-4d26-8579-8342ca757c8c)
20+
21+

0 commit comments

Comments
 (0)