- Posts: 16
- Thank you received: 0
Validation text+number
- Marcin R
- Topic Author
- Offline
- New Member
-
Less
More
4 years 4 days ago #143059
by Marcin R
Validation text+number was created by Marcin R
HI.
How to create validation for custom fileds:
1) Only for UTF-8 [a-Z]
2) Text + number
3) number + special characters like - or /
Regards.
How to create validation for custom fileds:
1) Only for UTF-8 [a-Z]
2) Text + number
3) number + special characters like - or /
Regards.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
4 years 4 days ago #143077
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Validation text+number
Hello Marcin
For this, it is very likely you will have to create server validation rules, eventbookingdoc.joomservices.com/basic-s...eld-data-server-side to see if there are any existing rules which you can use
Otherwise, you will have to build custom validation rules yourself eventbookingdoc.joomservices.com/basic-s...ld-custom-validators
Tuan
For this, it is very likely you will have to create server validation rules, eventbookingdoc.joomservices.com/basic-s...eld-data-server-side to see if there are any existing rules which you can use
Otherwise, you will have to build custom validation rules yourself eventbookingdoc.joomservices.com/basic-s...ld-custom-validators
Tuan
Please Log in or Create an account to join the conversation.
- Marcin R
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 16
- Thank you received: 0
4 years 4 days ago #143086
by Marcin R
Replied by Marcin R on topic Validation text+number
Only that doesn't really tell me anything. Because im not dev. but...
If you can check.
If you can check.
Code:
Valitron\Validator::addRule('rule_a_Z', function($field, $value, array $params, array $fields) {
$characters = 'aąbcdeęfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
if ($value = $charactersLength = strlen($characters))
{
return false;
}
return true; },
'The field must has only a-Z letter');
Please Log in or Create an account to join the conversation.
- Marcin R
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 16
- Thank you received: 0
4 years 3 days ago #143089
by Marcin R
Replied by Marcin R on topic Validation text+number
I add components/com_eventbooking/helper/validator.php validator.php and example code.
In custom fields add my_custom_rule| in Server Validation Rules
And validation not working.
what am I doing wrong?
In custom fields add my_custom_rule| in Server Validation Rules
And validation not working.
what am I doing wrong?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
4 years 3 days ago #143098
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Validation text+number
Hi Marin
The code will only be run when the form is submitted. So the main question here is did you press Process Registration button after entering form data?
Tuan
The code will only be run when the form is submitted. So the main question here is did you press Process Registration button after entering form data?
Tuan
Please Log in or Create an account to join the conversation.
- Marcin R
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 16
- Thank you received: 0
3 years 11 months ago #143261
by Marcin R
Replied by Marcin R on topic Validation text+number
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.