Home Forums Plugin Support WP User Frontend Pro Validate Frontend Textfield

This topic is: resolved

This topic contains 2 replies, has 3 voices, and was last updated by  Daniel 5 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3674

    zellermaniac
    Participant
    Post count: 40

    I need to validate a textfield. Only numbers.

    Better I can Validate every Field with Regular Expression.

    Does anyone have an example or a good link.

    Danke.Thx.

    #3677

    Tareq Hasan
    Keymaster
    Post count: 2831

    You can use JavaScript/jQuery to validate the field. Also if you need server side validation, there is validation filters: wpuf_add_post_validate and wpuf_update_post_validate.

    Example:
    [php]
    function my_example_validation() {
    if ( isset( $_POST[‘some_field'] ) ) {
    //do any validation
    //if any error found, return the error message
    return ‘You got some error';
    }

    return ”;
    }

    add_filter( ‘wpuf_add_post_validate', ‘my_example_validation' );
    [/php]

    #14293

    Daniel
    Member
    Post count: 3

    Neither wpuf_update_post_validate nor wpuf_edit_post_validate have any effect! ๐Ÿ™

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Validate Frontend Textfield’ is closed to new replies.