vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Profile Field Text Verification (https://vborg.vbsupport.ru/showthread.php?t=161553)

Desert VB 10-30-2007 08:24 PM

Profile Field Text Verification
 
I've searched/found/read quite a few threads on how to add custom profile fields but I can't find anywhere that explains how to "screen" what is entered.

For example, I added a profile field "Zip Code". How would I force a numeric entry of 5 digits? I get people entering a couple letters to get past the requirement instead of updating it properly.

Thanks!

--Phillip

Marco van Herwaarden 10-31-2007 09:24 AM

You can add a REGEX to verify the contents.

Desert VB 10-31-2007 12:42 PM

Regex?

Marco van Herwaarden 10-31-2007 12:49 PM

See 'Regular Expression' when editing the User Profile Field. See the help and the link to PCRE.

Desert VB 10-31-2007 02:17 PM

Ahhh, Yes, I saw that field/option when updating the profile fields, but the PCRE link made NO sense. :(

The field for RegEx is only 1 line, and fairly short in length. The PCRE help link only shows email validation examples, and they take several lines of code to make work.

--------------- Added [DATE]1193844115[/DATE] at [TIME]1193844115[/TIME] ---------------

Upon further reading, can I just enter this into the field?

/^[0-9][0-9][0-9][0-9][0-9]$/

--------------- Added [DATE]1193844115[/DATE] at [TIME]1193844115[/TIME] ---------------

Ok, that didn't work, so I just used:

[0-9][0-9][0-9][0-9][0-9]

And it worked. Thanks!

Now how would I allow unlimited chars A-z, but exclude 0-9 and all special chars?

LOL, My head hurts.


All times are GMT. The time now is 10:05 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01006 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete