Forum Replies Created
-
are you trying to validate phone numbers? if so, this is now built in:
http://userproplugin.com/userpro/forums/topic/new-update-available-v1-0-86/
however here is the info:
open: functions/ajax.php
find this:
case ‘username_exists’:
if (username_exists($input_value)){
$output[‘error’] = __(‘Username already taken.’,’userpro’);
} else if ( !preg_match(“/^[A-Za-z0-9_]+$/”, $input_value) ) {
$output[‘error’] = __(‘Illegal characters are not allowed in username.’,’userpro’);
}
break;and right underneath add:
case ‘phone_validation’:
if ( !preg_match(“/\d{3}-\d{3}-\d{4}/”, $input_value) ) {
$output[‘error’] = __(‘Enter number in this format 999-999-9999,’userpro’);
}
break;**make sure to enter phone_validation under the ajax callback
in reply to: Form Field ValidationOk for anyone reading this just to recap, if you create a custom dropdown field with numerical options say, 1,2,3,4,5… then if a user selects a number say 3, then their profile view will say 4.
In fact if you use 2,3,4,5,6 in the dropdown then the profile view is off by 2.
I think this is a bug that needs to be fixed.
in reply to: Custom Field Increment by 1no problem, happy to help, hopefully it works for you.
in reply to: Form Field ValidationHey I’m Canadian Eh! Tomas, thank you for your comments, very insightful and helpful.
To others reading this, ajax validation is pretty useful if you know the custom code, you can validate pretty much anything.
For us “Americans” the code I posted above will validate our phone numbers.
in reply to: Form Field ValidationI agree, phone validation and input mask should be built into the plugin without custom code but for now you have to use ajax validation.
Open up functions/ajax.php and add:
case ‘phone_validation’:
if ( !preg_match(“/^\d{10}$/”, $input_value) ) {
$output[‘error’] = __(‘Phone number should be 10 digits’,’userpro’);
}
break;then in userpro find your phone field and under ajax check callback (advanced) put: phone_validation
remember that when you update the plugin this will be lost so backup ajax.php.
also if you would rather have something like 999-999-9999 use this instead:
case ‘phone_validation’:
if ( !preg_match(“/\d{3}-\d{3}-\d{4}/”, $input_value) ) {
$output[‘error’] = __(‘Enter number in this format 999-999-9999,’userpro’);
}
break;hope this helps,
in reply to: Form Field ValidationI believe he is having the same issue that wasn’t resolved here:
http://userproplugin.com/userpro/forums/topic/custom-field-increment-by-1/
in reply to: Profile age field issueI am really confused by this, so if data inside dropdown boxes have sequential numbers then they will auto increment?
in reply to: Custom Field Increment by 1This is fixed in the latest version, thank you!
in reply to: mobile dropdown widthI’m sorry, i don’t understand your answer.
For example, if I ask “how old are you?” and the user selects 18, on their view screen it will show age as 19. How is this normal?
Also, this only happens with drop down menus.
in reply to: Custom Field Increment by 1This reply has been marked as private.in reply to: Custom Field Increment by 1As an update I tried http://userproplugin.com/userpro/profile/register/ on an iPhone 4S and an iPhone 5 and the same issue occurs on both. I asked my friend to try on his Galaxy S3 and same issue.
dropdown menus do not seem to be responsive on mobile devices.
in reply to: mobile dropdown widthhere is the screenshot:
in reply to: mobile dropdown widththat’s not the same as trying on an actual iPhone. Maybe someone else can verify this on a physical iPhone. I will send a screenshot soon to show this.
in reply to: mobile dropdown widthon the fronted, when a user logs in through userpro, all looks good, no error messages are displayed, and the user is allowed access to the site.
However other plugins such as wordfence, login logs, etc. report the multiple log in attempts when logging in through userpro, this doesn’t happen when userpro is disabled.
in reply to: Multiple / Failed login attemptjust wanted to add that I also tried disabling wordfence and then used a plugin to log failed login attempts and the logs showed the same thing as described above.
in reply to: Multiple / Failed login attempt