vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How Do I Validate Input Data, In Custome Fields (https://vborg.vbsupport.ru/showthread.php?t=248700)

Come2Daddy 08-15-2010 09:27 PM

How Do I Validate Input Data, In Custome Fields
 
Hi there,

I'm trying to add some custom fields the profile fields & I want to validate it's inputs, so for instance, let's say I want to add a mobile phone number field, & I want to ensure that the one who submit the mobile number can't insert any data type except numbers

any idea??

Boofo 08-15-2010 09:33 PM

You can use regex to validate the input.

Come2Daddy 08-15-2010 10:02 PM

This is exactly what I'm looking for, I don't know how to use the regular expression function within an integrated script,
where to use it??
where should I write my validation code?? in template??
or I should in vbulletin files??
or in some hooks places vbulletin provided them???

Boofo 08-15-2010 10:12 PM

There is a place to add it in the profile field setup. ;)

Come2Daddy 08-15-2010 11:16 PM

Are you serious, I can put any validation pattern in the custom field setup??? How?

Boofo 08-15-2010 11:23 PM

Regular Expression (under Show on Member's List).

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

Try this for the regex:

Quote:

^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$

It will have to look like this to pass:

Quote:

555-123-4567

Come2Daddy 08-16-2010 01:18 AM

I thought you're fooling around with me, because I was writing to you via my mobile phone, but when I get home back I checked my admincp & I found the pattern input field

Thanks a lot

Boofo 08-16-2010 03:15 AM

No problem. ;)


All times are GMT. The time now is 09:17 PM.

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.00990 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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