Results 1 to 2 of 2

Thread: Custom field + custom validation

  1. #1
    Thread Starter
    areis's Avatar
    Join Date
    Oct 2010
    Location
    Portugal
    Posts
    129
    Thanks
    17
    Thanked 16 Times in 13 Posts

    Custom field + custom validation

    I'd like to include a text field in my ad forms, but need to validate it's contents. Specifically, I'd like to see if it starts with one of 3 strings. (Perhaps more than 3, later on).
    Say the 3 strings are '123', 'abc' and '...'.
    "123456" would be valid;
    "aaabc" would not be valid.
    "......" Would also be valid.

    Can anyone offer any suggestion on what would be the best way to approach this?
    I think I can write the validation function myself, returning 1 or 0, or True or False... but where would I put it , and how would it be called?

    Thanks,
    AReis
    Free classifieds site using Classipress in Portuguese - Boas-oportunidades;
    House rentals in Portugal - Arrenda PT; House rentals in Brazil - Arrenda BR.

  2. #2
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,229
    Thanks
    89
    Thanked 593 Times in 491 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    arthemes.org - AppThemes plugins, tutorials, modifications and services

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add datepicker to custom field as a field type
    By ellie in forum ClassiPress General Discussion
    Replies: 44
    Last Post: April 10th, 2014, 05:45 AM
  2. Replies: 18
    Last Post: October 9th, 2011, 11:24 PM
  3. Inserting a custom field from a custom form into the listing preview
    By Fanatic in forum ClassiPress General Discussion
    Replies: 4
    Last Post: May 1st, 2011, 07:17 PM
  4. [SOLVED] Custom field order in frontend doesn't match with custom field order set in backend
    By bluecafe in forum Report ClassiPress Bugs
    Replies: 11
    Last Post: November 24th, 2010, 08:47 AM