Support » Plugin: Contact Form 7 » One text field causes error whenever there is a space.

  • JS

    (@itanjillc)


    Hi there,

    I have a really strange issue with a form I’m building with CF7. I have one field that I have tried renaming multiple times, but I still seem to get the same error, over and over. Here’s my Form Code:

    <label>SEVERITY OF INCIDENT: This is a report of</label><span class="requiredText">*</span>: [checkbox* severity-of-incident id:inline-checkbox use_label_element "Death" "Lost Time" "Medical Treatment" "First Aid Only" "Near Miss"]
    
    <label>Employee Name<span class="requiredText">*</span>: [text* employee-name]</label>
    
    <label>SID#<span class="requiredText">*</span>: [text* sid-number]</label>
    
    <label>DOB</label><span class="requiredText">*</span>: [date* date-of-birth date-format:mm/dd/yy placeholder "MM/DD/YYYY"]
    
    <label>Employee Home Address (Street, City, Zip)<span class="requiredText">*</span>: [text* employee-home-address]</label>
    
    <label>Job Title<span class="requiredText">*</span>: [text* text-555]</label>
    
    <label>Department<span class="requiredText">*</span>: [text* department]</label>
    
    <label>Date of Injury</label><span class="requiredText">*</span>: [date* date-of-injury date-format:mm/dd/yy placeholder "MM/DD/YYYY"]
    
    <label>Time of Injury</label><span class="requiredText">*</span>: [text* time-of-injury-hh 2/2 placeholder "HH"] : [text* time-of-injury-mm 2/2 placeholder "MM"] [text* time-of-injury-ampm 5/2 placeholder "AM/PM"]
    
    <label>Time You Began Work</label><span class="requiredText">*</span>: [text* time-you-began-work-hh 2/2 placeholder "HH"] : [text* time-you-began-work-mm 2/2 placeholder "MM"] [text* time-you-began-work-ampm 5/2 placeholder "AM/PM"]
    
    <label>Witness(es)<span class="requiredText">*</span>: [text* witnesses]</label>
    
    <label>Describe Incident, Give Full Details of What Happened<span class="requiredText">*</span>: [textarea* incident-description]</label>
    
    <label>Exactly Where Were You When Incident Occurred?<span class="requiredText">*</span> [text* where-were-you]</label>
        
    <label>What Were You Doing Just Before Incident Occurred?<span class="requiredText">*</span> [text* what-were-you-doing]</label>
        
    <label>What Happened and How Did Injury or Incident Occur?<span class="requiredText">*</span> [text* what-happened]</label>  
        
    <label>What Was the Injury or Illness Resulting from Incident?<span class="requiredText">*</span> [text* what-was-the-injury]</label>   
        
    <label>What Object or Substance Hurt You or Caused a Near Miss?<span class="requiredText">*</span> [text* what-object-or-substance]</label>
        
    <label>List Any Personal Protective Equipment Worn (if applicable)?<span class="requiredText">*</span><br/>
    [text* list-any-ppe]</label>
    
    <label>Part of the Body Injured?</label><span class="requiredText">*</span>
    (Select all that apply. Ctrl+click for <i class="fa fa-windows" aria-hidden="true"></i> OR Command+click for <i class="fa fa-apple" aria-hidden="true"></i>)
    	[select* part-of-body-injured multiple "Head" "Eye - Left" "Eye - Right" "Nose" "Mouth" "Ear - Left" "Ear - Right" "Neck" "Chest" "Shoulder - Left" "Shoulder - Right" "Arm - Left" "Arm - Right" "Wrist - Left" "Wrist - Right" "Hand - Left" "Hand - Right" "Finger - Left Hand" "Finger - Right Hand" "Hip - Left" "Hip - Right" "Back, upper" "Back, lower" "Thigh - Left" "Thigh - Right" "Knee - Left" "Knee - Right" "Leg - Left" "Leg - Right" "Ankle - Left" "Ankle - Right" "Foot - Left" "Foot - Right" "Toe - Left Foot" "Toe - Right Foot" "Internal"]
    	
    <label>Type of Injury/Exposure?</label><span class="requiredText">*</span>
    	(Select all that apply. Ctrl+click for <i class="fa fa-windows" aria-hidden="true"></i> OR Command+click for <i class="fa fa-apple" aria-hidden="true"></i>)
    [select* type-of-injury-exposures multiple "Puncture Wound" "Laceration" "Foreign Body" "Sprain/Strain" "Tendonitis" "Contusion" "Fracture/Dislocation" "Curn/Scald" "Hernia" "Infectious Disease" "Irritations/Dermatitis" "Respiratory" "Other (Describe below)"]
    
    <label>Other: [text other-injury]</label>
    
    <label>Cause of Incident</label><span class="requiredText">*</span>
    	(Select all that apply. Ctrl+click for <i class="fa fa-windows" aria-hidden="true"></i> OR Command+click for <i class="fa fa-apple" aria-hidden="true"></i>)
    [select* cause-of-incident multiple "Fall From Chair or Equipment" "Fall On Same Level" "Fall from Different Level" "Fall From Fainting" "Slip on Something" "Slip, no fall" "Spill-Spray" "Struck by Equipment" "Struck by Person" "Struck by Tool or Object" "Heart Attack" "Pulling" "Pushing" "Lifting" "Reaching or Bending" "Exposure" "Inhalatino" "Recurrence of old injury" "Re-injury same type/body part" "Other (Describe)"]
    
    <label>Other: [text other-incident]</label>
        
    <p>CHECK AND COMPLETE ALL THAT APPLY BELOW:</p>
    <p>Did you receive first aid treatment?<span class="requiredText">*</span> [checkbox* first-aid-received exclusive id:inline-checkbox use_label_element "Yes" "No"]</p>
    <p>Were you treated by a Physician?<span class="requiredText">*</span> [checkbox* treated-by-physician exclusive id:inline-checkbox use_label_element "Yes" "No"]</p>
    <p>Were you treated in emergency room?<span class="requiredText">*</span>[checkbox* treated-in-emergency-room exclusive id:inline-checkbox use_label_element "Yes" "No"]</p>
    <p>Did you spend overnight in hospital?<span class="requiredText">*</span>[checkbox* overnight-in-hospital exclusive id:inline-checkbox use_label_element "Yes" "No"]</p>
    <p>Will you lose time from regular work?<span class="requiredText">*</span>[checkbox* lose-time-from-regular-work exclusive id:inline-checkbox use_label_element "Yes" "No"]
    <label>Estimate # of Days<span class="requiredText">*</span>: [text* estimate-number-of-days]</label></p>
    <p><label>Employee Signature<span class="requiredText">*</span>: [text* employee-signature placeholder "TYPE FULL NAME"]</label></p>
    <p><label>Date</label><span class="requiredText">*</span>: [date* signature-date date-format:mm/dd/yy placeholder "MM/DD/YYYY"]
    </p>
    [submit "Send"]

    Then for the mail tab:

    SEVERITY OF INCIDENT: 
    <strong>This is a report of:</strong> [severity-of-incident]
    
    <strong>Employee Name:</strong> [employee-name]
    
    <strong>SID#:</strong> [sid-number]
    
    <strong>DOB:</strong> [date-of-birth]
    
    <strong>Employee Home Address (Street, City, Zip):</strong> [employee-home-address]
    
    <strong>Job Title:</strong> [text-555]
    
    <strong>Department:</strong> [department]
    
    <strong>Date of Injury:</strong> [date-of-injury]
    
    <strong>Time of Injury:</strong> [time-of-injury-hh]:[time-of-injury-mm] [time-of-injury-ampm]
    
    <strong>Time You Began Work:</strong> [time-you-began-work-hh]:[time-you-began-work-mm] [time-you-began-work-ampm]
    
    <strong>Witness(es):</strong> [witnesses]
    
    <strong>Describe Incident, Give Full Details of What Happened:</strong> [incident-description]
    
    <strong>Exactly Where Were You When Incident Occurred:</strong> [where-were-you]
        
    <strong>What Were You Doing Just Before Incident Occurred:</strong> [what-were-you-doing]
        
    <strong>What Happened and How Did Injury or Incident Occur:</strong> [what-happened]  
        
    <strong>What Was the Injury or Illness Resulting from Incident:</strong> [what-was-the-injury]   
        
    <strong>What Object or Substance Hurt You or Caused a Near Miss:</strong> [what-object-or-substance]
        
    <strong>List Any Personal Protective Equipment Worn (if applicable):</strong> [list-any-ppe]
    
    <strong>Part of the Body Injured:</strong> [part-of-body-injured]
    	
    <strong>Type of Injury/Exposure:</strong> [type-of-injury-exposures]
    
    <strong>Other:</strong> [other-injury]
    
    <strong>Cause of Incident:</strong> [cause-of-incident]
    
    <strong>Other:</strong> [other-incident]
        
    <p>CHECK AND COMPLETE ALL THAT APPLY BELOW:</p>
    
    <p><strong>Did you receive first aid treatment:</strong> [first-aid-received]</p>
    <p><strong>Were you treated by a Physician:</strong> [treated-by-physician]</p>
    <p><strong>Were you treated in emergency room:</strong> [treated-in-emergency-room]</p>
    <p><strong>Did you spend overnight in hospital:</strong> [overnight-in-hospital]</p>
    <p><strong>Will you lose time from regular work:</strong> [lose-time-from-regular-work]
    <strong>Estimate # of Days:</strong> [estimate-number-of-days]</p>
    <p><strong>Employee Signature:</strong> [employee-signature]</p>
    <p><strong>Date:</strong> [signature-date]</p>

    If I type anything with spaces in the field for Job Title, I get an error, “There was an error trying to send your message. Please try again later.” I can’t seem to figure out why this is only happening with this one specific text field, but I’m hoping someone else can see something I don’t.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    See https://contactform7.com/setting-up-mail/

    Set up mail correctly.

    Thread Starter JS

    (@itanjillc)

    Hi Takayuki,

    Mail is setup correctly, as I’m getting form submissions, unless I include the additional text field in my ContactForm7:

    <label>Job Title<span class=”requiredText”>*</span>: [text* text-555]</label>

    That’s when the form throws me an error.

    Thread Starter JS

    (@itanjillc)

    Any ideas on why this one field is potentially giving me problems? I’ve tried renaming it, moving it, but it still will give me the same issue.

    Thread Starter JS

    (@itanjillc)

    One more thing I found out is that if I have any spaces in that field, I will get an error. Remove spaces, and no error occurs. Obviously, I’ll need spaces in that text field.

    Thread Starter JS

    (@itanjillc)

    I’ve confirmed the bug on another domain/web site. Same exact issue. If you create a new CF7 form with the code I supplied above, you’ll see what I mean.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘One text field causes error whenever there is a space.’ is closed to new replies.