Title: Text Field Code Error
Last modified: June 5, 2022

---

# Text Field Code Error

 *  Resolved [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/)
 * Hello and thank you for the plugin. I was trying to use this code from one of
   your posts for an extra field but I got an error message. Here’s the code I used
   but of course I changed the title, placeholder, and text:
 *     ```
       add_action( 'give_fields_after_donation_amount', function( $group ) {
           $group->append(
               give_field( 'text', 'mothersName' )
                   ->showInReceipt()
                   ->minLength(2)
                   ->label( __( 'Mother\'s Name' )
                   ->maxLength(30)
                   ->placeholder('Mother\'s name')
                   ->required() // Could instead be marked as readOnly() (optional)
                   ->helpText( __( 'This is a field used to add your mother\'s name' ) ) //how this is displayed is up to the template, but if the template has help text displayed, this is how to set it.
           );
       });
       ```
   
 * I got this error in my functions.php:
 * >  Exception thrown without a stack frame
 * I will appreciate your help.

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

 *  Plugin Support [Matheus Martins](https://wordpress.org/support/users/matheusfd/)
 * (@matheusfd)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15727450)
 * Hey, [@h2ofilters](https://wordpress.org/support/users/h2ofilters/).
 * ​Glad you reached out. I can help you with that.
 * You are missing a parathesis on the label property. Your code should look like
   this instead:
 *     ```
       add_action( 'give_fields_after_donation_amount', function( $group ) {
           $group->append(
               give_field( 'text', 'mothersName' )
                   ->showInReceipt()
                   ->minLength(2)
                   ->label( __( 'Mother\'s Name' ))
                   ->maxLength(30)
                   ->placeholder('Mother\'s name')
                   ->required() // Could instead be marked as readOnly() (optional)
                   ->helpText( __( 'This is a field used to add your mother\'s name' ) ) //how this is displayed is up to the template, but if the template has help text displayed, this is how to set it.
           );
       });
       ```
   
 * ​Please let us know if you have further questions or need additional assistance!
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15727614)
 * It works! Thank you so much
    -  This reply was modified 3 years, 11 months ago by [dareadel](https://wordpress.org/support/users/h2ofilters/).
 *  Plugin Support [Matheus Martins](https://wordpress.org/support/users/matheusfd/)
 * (@matheusfd)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15727671)
 * You are welcome, [@h2ofilters](https://wordpress.org/support/users/h2ofilters/).
 * Can you help me too? We’d love to get a public review about what you think of
   GiveWP, both from a product standpoint and how it is to deal with our team. Here
   are some options:
 * G2: [https://www.g2.com/products/givewp/reviews](https://www.g2.com/products/givewp/reviews)
   
   WordPress: [https://wordpress.org/support/view/plugin-reviews/give](https://wordpress.org/support/view/plugin-reviews/give)
   Google: [https://g.page/givewp/review?rc](https://g.page/givewp/review?rc) Facebook:
   [https://www.facebook.com/pg/wpgive/reviews/](https://www.facebook.com/pg/wpgive/reviews/)​
   The reviews help others decide if it’s worth doing business with us!
 * Have a great day!
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15727690)
 * Certainly. I can write a review.
 * However, I have one more question. How do you get the field to appear on a donor’s
   confirmation messages?
 * We did a test but the field did not appear in a confirmation message or the receipt.
 * Thank you
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15727761)
 * Never mind. I found the tag in the settings
 *  Plugin Support [Matheus Martins](https://wordpress.org/support/users/matheusfd/)
 * (@matheusfd)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15727815)
 * Happy to hear that it is working, [@h2ofilters](https://wordpress.org/support/users/h2ofilters/).
 * I’d you need further assistance, we are happy to help.
 * Have a great day! 🙂
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15744929)
 * Hi [@matheusfd](https://wordpress.org/support/users/matheusfd/),
 * Unfortunately, the field is not displayed in confirmation emails.
 * Here’s the email setup:
 *     ```
       Donor: {fullname}
       Donation: {donation}
       Donation on behalf of...: {guest Name}
   
       Donation Date: {date}
   
       Amount: {amount}
       Payment Method: {payment_method}
       Payment ID: {payment_id}
   
       {receipt_link}
   
       Sincerely,
       {sitename}
       ```
   
 * The field output for** “Donation on behalf of…”** is not showing in the confirmation
   email messages.
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15754826)
 * Just a followup, I have no space in {guestName}
 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15765998)
 * Hi [@h2ofilters](https://wordpress.org/support/users/h2ofilters/),
 * I’m unable to replicate this. Can you share the code that you’re using to add
   the custom field?
 * Thanks!
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15766205)
 * Thank you [@mrdaro](https://wordpress.org/support/users/mrdaro/),
 * Here is the code. I hope I can get this resolved quite soon. The event is in 
   July, just a week away.
 *     ```
       //Extra field for donations
       add_action( 'give_fields_after_donation_amount', function( $group ) {
           $group->append(
               give_field( 'text', 'guestName' )
                   ->showInReceipt()
                   ->minLength(2)
                   ->label( __( 'Donation on behalf of...' ))
                   ->maxLength(30)
                   ->placeholder('Name of alumnus')
                   ->required() // Could instead be marked as readOnly() (optional)
                   ->helpText( __( 'This is a field used to add the alumnus name on behalf whom you you are donating' ) ) //how this is displayed is up to the template, but if the template has help text displayed, this is how to set it.
           );
       });
       ```
   
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15774775)
 * I gave a reply [@mrdaro](https://wordpress.org/support/users/mrdaro/) over 4 
   days now. So what’s next?
 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15776047)
 * Hi [@h2ofilters](https://wordpress.org/support/users/h2ofilters/),
 * I tested your code and it’s working for me. Here’s quick screencast to demonstrate
   what I did and how I tested: [https://somup.com/c31t3Kt9f4](https://somup.com/c31t3Kt9f4)
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15776280)
 * Thank you [@mrdaro](https://wordpress.org/support/users/mrdaro/),
 * Unfortunately I didn’t see the same thing you’re seeing. It appears you have 
   a different plugin. My Give post type name is “Donations” but yours is “Contributions.”
   Even when I go to the list of donors and I viewed it doesn’t show “receipt.”
 * The question is do you need the pro version of the plugin for the code to work,
   and show “Contributions” instead of “Donations?”
 *  Plugin Support [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15776345)
 * It’s the same plugin. Mine says “Contributions” because I translated the term
   for a different ticket. Sorry for the confusion, nonetheless, everything else
   is the same.
 *  Thread Starter [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * (@h2ofilters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15776457)
 * Thank you so much, [@mrdaro](https://wordpress.org/support/users/mrdaro/). I 
   tried again and it works now. Not sure what happened before.
    -  This reply was modified 3 years, 11 months ago by [dareadel](https://wordpress.org/support/users/h2ofilters/).
    -  This reply was modified 3 years, 11 months ago by [dareadel](https://wordpress.org/support/users/h2ofilters/).

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

The topic ‘Text Field Code Error’ is closed to new replies.

 * ![](https://ps.w.org/give/assets/icon-256x256.jpg?rev=2873287)
 * [GiveWP - Donation Plugin and Fundraising Platform](https://wordpress.org/plugins/give/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/give/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/give/)
 * [Active Topics](https://wordpress.org/support/plugin/give/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/give/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/give/reviews/)

## Tags

 * [text field](https://wordpress.org/support/topic-tag/text-field/)

 * 15 replies
 * 3 participants
 * Last reply from: [dareadel](https://wordpress.org/support/users/h2ofilters/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/text-field-code-error/#post-15776457)
 * Status: resolved