WordPress.org

Ready to get started?Download WordPress

Forums

Fast Secure Contact Form
Validation Regex (3 posts)

  1. bkss
    Member
    Posted 2 years ago #

    I want the user to enter a rating-value with dots instead of comma, for example 1.234 not 1,234.
    How do a "force" the submitter to this?
    The string /^\d+$/ does not allow to use either comma or dot, only digits.

    Is there a validation regex that I can use instead?

    http://wordpress.org/extend/plugins/si-contact-form/

  2. Mike Challis
    Member
    Plugin Author

    Posted 2 years ago #

    of course there's the validation regex for anything, you just have to write it ;)

    /^[\d.]+$/

  3. bkss
    Member
    Posted 1 year ago #

    I've tried your proposal and it works fine!
    I assumed that it was quite easy to fix, but could not figure that out based on the string /^\d+$/. And google could also not help me! :-)

    Thanks a lot for your help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic