Title: Text* Validation
Last modified: February 8, 2024

---

# Text* Validation

 *  Resolved [rastarime](https://wordpress.org/support/users/rastarime/)
 * (@rastarime)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/text-validation/)
 * Good morning,
 * I have implemented a simple form with First Name, Last Name, Phone, Mail, 2 acceptance
   checkboxes and a field for uploading pdf files.
 * The form behaves that as long as the first mandatory checkbox is not ticked, 
   the button cannot be clicked and the check on the fields is not done.
 * The problem is that a check is made on the Phone field (only accepting numbers),
   a check is made on the email but no check is made on the first and last name 
   fields.
 * Is it possible to run a check on the two fields, a simple true/false if it is
   filled in?
 * I enclose the form code below:
 *     ```wp-block-code
       [text* Nome "Nome *"]
       [text* Cognome "Cognome *"]
       [tel* phone "Telefono *"]
       [email* mail "Email *"]
       <br>
       [acceptance Trattamentodati "Acconsento al trattamento dei miei dati personali ai sensi dell'articolo 13 del Regolamento (UE) 2016/679 *"]
       [acceptance Trattamentocommerciale optional "Acconsento al trattamento dei dati per comunicazioni commerciali e informative su Eventi, Prodotti e Servizi"]
       <br>
       <label> Carica il tuo CV (in formato PDF - max 1MB)
           [file* FileCV limit:1mb filetypes:pdf] </label>
       <br>
       [submit "Invia il Curriculum"]
       ```
   
 * Cordially!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftext-validation%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/text-validation/#post-17411150)
 * I checked the form and confirmed that you get the “Compila questo campo.” message
   if you leave the Nome or Cognome field blank.
 *  Thread Starter [rastarime](https://wordpress.org/support/users/rastarime/)
 * (@rastarime)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/text-validation/#post-17481162)
 * Hi Takayuki Miyoshi,
 * is there any way to solve this problem?
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/text-validation/#post-17481309)
 * What problems do you have?
 *  Thread Starter [rastarime](https://wordpress.org/support/users/rastarime/)
 * (@rastarime)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/text-validation/#post-17481344)
 * the form posted above, although you have control over the text fields, when you
   click on the submit button the control is skipped and the data is sent.
 * For example, if I leave the text fields empty but fill in everything else, the
   form submits the data skipping the check.
 *  Thread Starter [rastarime](https://wordpress.org/support/users/rastarime/)
 * (@rastarime)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/text-validation/#post-17481899)
 * Hi,
   I solved the problem by rewriting the contact form code like this:
 *     ```wp-block-code
       [text* Nome placeholder "Nome *"] 
       [text* Cognome placeholder "Cognome *"]
       [tel* phone placeholder "Telefono *"] 
       [email* mail placeholder "Email *"]
       <br>
       [acceptance Trattamentodati] Acconsento al trattamento dei miei dati personali ai sensi dell'articolo 13 del Regolamento (UE) 2016/679 * [/acceptance]
       [acceptance Trattamentocommerciale optional] Acconsento al trattamento dei dati per comunicazioni commerciali e informative su Eventi, Prodotti e Servizi [/acceptance]
       <br>
       <label> Carica il tuo CV (in formato PDF - max 1MB)
           [file* FileCV limit:1mb filetypes:pdf] </label>
       <br>
       [submit "Invia il Curriculum"]
       ```
   
    -  This reply was modified 2 years, 4 months ago by [rastarime](https://wordpress.org/support/users/rastarime/).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Text* Validation’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [rastarime](https://wordpress.org/support/users/rastarime/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/text-validation/#post-17481899)
 * Status: resolved