Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi I-Visio,

    Name is already required. I have written a couple micro-plugins for requiring a phone number. This one will just check if the phone field is empty. This one will also try to validate the phone number by ensuring only certain characters are included. If using the latter, please note the warnings about using this:

    Be careful, though. You don’t want to make it so strict that a potential diner gets frustrated. Some people write numbers with parentheses, some with spaces, some with dashes. Some people use full area codes. Some people just use local numbers. Make sure you’re not limiting it too much.

    All other fields are already required, with the exception of the Message field, which is hidden by default and so probably shouldn’t be required.

    I forgot to tell you how to use the micro-plugins. After following the link, click the “Download Gist” on the right. Upload the .php file to your /wp-content/plugins/ directory. You can then activate the plugin from the plugins list in your WordPress admin panel.

    Hi Nate, your plugin is fantastic but I have some problems.

    I can’t translate the booking fields in Italian (“When would you like to book?”, “Party Size”, “preferred dining time”, “name”, “phone”, “message”, and the button “book my table”).
    The email field I wish it was a sensitive field to the proper completion of the email ([email protected]), same thing for the field phone number (numbers only).

    Is this possible? Can you tell me how can I do it please?

    Hi surfilwave,

    You’ll find information about translating as well as making the phone number required in the plugin’s FAQ.

    I’ve left email validation out because it’s actually a very difficult problem to get right without unintentionally blocking some email addresses. However, if you want a very simple validation check, I’ve written a micro addon that checks for @.

    Once you’ve read the post about the required phone number, you’ll understandhow to make use of the micro-addon for email validation as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Required fields’ is closed to new replies.