RSVPMaker 2.5 and new method for customizing the RSVP Form

RSVPMaker 2.5 is out and introduces a new method for customizing the RSVP form. It also fixes some glitches with the recurring event setting function and the JavaScript on the RSVP form. (See also setting required fields, updated list of shortcodes).

Form Customization

I’ve received many requests from people who wanted to make more customizations than I allowed for with the built-in administrative tools. For example, some people did not want to include the section that asks for the names of guests. Previously, the only alternative I offered was code-level customization (I tried to add flexibility with a technique for adding a rsvpmaker-custom.php file). NOTE: If you previously customized the form, this release may break your customizations.

I ran into my own requirement for customization recently when I used the form for a luncheon where people were supposed to choose from among 3 meal choices. So the form needed to be different for that one event. It’s now possible to create a custom form for a single event, in addition to the default RSVP Form for the site.

There is now an RSVP Form field that appears on the main RSVPMaker settings screen, as well as the RSVP options panel on the event editing screen.

The default code for the body of the form looks like this:

You can now modify the HTML structure around the form fields as much as you would like. It is important that you include the fields first, last, and email for your form to function properly. But you can add any other fields you might like.

With the exception of the notes textarea, fields are represented by the shortcodes [rsvpfield textfield=”fieldname”] or [rsvpfield selectfield=”fieldname” options=”option1,option2″]. For my luncheon scenario, I could have done something like [rsvpfield selectfield=”meal” options=”Chicken,Salmon,Vegetarian Plate”]

There is also a [rsvpprofiletable show_if_empty=”phone”] shortcode which is an optional block that will not be displayed if the specified data (such as a phone number) is already “on file” from a prior RSVP. For this to work, there must also be a [/rsvpprofiletable] closing tag.

The guest section of the form is represented by [rsvpguests] (no parameters). If you don’t want the guest blanks to show up, you can remove this.

The form code you supply will be wrapped in a form tag with the CSS ID of “rsvpform”.  The yes/no radio buttons and certain other fields that are generated from code for PayPal payments or timeslot reservations are still outside the bounds of what you can customize with this method.

I hope most users will find this to be an improvement.

Update Nov. 2013: The rsvpfield shortcode now also supports checkbox=”fieldname” and radio=”fieldname” parameters as an alternative to textfield and select. Checkbox must be used in combination with value=”somevaluehere” to specify what value should be submitted if the checkbox is checked. See the updated list of shortcodes.

The radio parameter works similarly to select, where you specify options=”option1,option2,option3″ – one additional option you can use here is sep=”<br />” to include a line break between radio button options. Line break is actually the default, but in the example above I used sep=” ” to put a space between the radio buttons. I could also do two spaces as sep=”&nbps;&nbps;” or wrap a <div> tag around the whole thing and use sep=”</div><div>” to make each choice appear in a separate div.

69 thoughts on “RSVPMaker 2.5 and new method for customizing the RSVP Form”

      1. I am a member of a Snowmobile club, and I added a custom field to enter the name of a person you will be sharing a room while attending a club event. What I would like to show is the person’s name who rsvp’d, and also the name entered in the custom field for the roommate in place of the of the notes field.

        (i.e RSVP User / rooomate) or something like that.

        Is that possible?

          1. Yes, that is correct. This way people interested in signing up will know if there is someone available to share room cost with or need to get a place on there own,

          2. Maybe I need a more flexible way of handling this, but here’s what I can suggest for your immediate need.

            If you follow the directions on this site for creating an rsvpmaker-custom.php file, you should be able to paste in code to override the built in function for retrieving guest details.
            See http://www.rsvpmaker.com/2010/12/changing-the-rsvp-form-other-customizations/Your custom function would look something like this:

            function ajax_guest_lookup() {

            if(!isset($_GET[“ajax_guest_lookup”])) return;

            $event = $_GET[“ajax_guest_lookup”];
            global $wpdb;
            $sql = “SELECT first,last,note FROM “.$wpdb->prefix.”rsvpmaker WHERE event=$event AND yesno=1 ORDER BY id DESC”;
            $attendees = $wpdb->get_results($sql);echo ”;
            foreach($attendees as $row)
            {?>
            first;?> last;?>

            details)
            {
            $detailsarray = unserialize($row->details);
            if($detailsarray[“roommate”])  { 
            $roommate = htmlentities(strip_tags($detailsarray[“roommate”])); 
            echo “<p>Roommate: $roommate</p>”; 
            }

            }

            if($row->note);
            echo wpautop($row->note);

            }

            echo ”;
            exit();
            }

          3.  The way it works is that rsvpmaker checks for the existence of an rsvpmaker-custom.php file in wp-content/plugins (the directory above wp-content/plugins/rsvpmaker). Any functions included in that file will override functions in rsvpmaker-pluggable.php that have the same name. In this case, you’re overriding ajax_guest_lookup()

            You wouldn’t want to modify rsvpmaker-pluggable.php because your changes would be overwritten the next time you updated the plugin.

          4.  Okay, Created the rsvp_custom.php, added to the plug-ins directory as explained, still to not see the roommate field. Is there anything I am missing?

          5. The filename should be rsvpmaker-custom.php

            Make sure you midify the sample code I provided to match the custom field in your RSVP form.

            If you specified your custom filed as [rsvpfield textfield="xfield"] then you’d be looking for $detailsarray[“xfield”] where I had $detailsarray[“roommate”]

          6. Okay, I have rsvpmaker-custom.php, code entered as menitoned. I have checked the field name in the rsvp form which matches the field names in the custom file. Still am not seeing the roommate field in the attendee list.  What else could I check?

  1. When I remove [rsvpguests] from the code I get a bunch of errors.  

    Warning: Invalid argument supplied for foreach() in /homepages/32/d399957389/htdocs/uscnewcomers/wp-content/plugins/rsvpmaker/rsvpmaker-plugabble.php on line 276Warning: Invalid argument supplied for foreach() in /homepages/32/d399957389/htdocs/uscnewcomers/wp-content/plugins/rsvpmaker/rsvpmaker-plugabble.php on line 328Warning: Cannot modify header information – headers already sent by (output started at /homepages/32/d399957389/htdocs/uscnewcomers/wp-content/plugins/rsvpmaker/rsvpmaker-plugabble.php:276) in/homepages/32/d399957389/htdocs/uscnewcomers/wp-content/plugins/rsvpmaker/rsvpmaker-plugabble.php on line 354

    1. Any thoughts on what I might be doing wrong?  I just want to remove the guest section.  Actually I want to just have First Name, Last Name, Email, and Notes.  No Phone Number or Guest Section, but when I remove those, I get errors.  

      1. My husband looked at the code in rsvpmaker-plugabble.php and there were two places that had a
        foreach($_POST[“guestfirst”] as $first)
        that was causing the issue (line 276 and 328) when [rsvpguests] was removed from the event page.  He put a
        if( isset($_POST[“guestfirst”]) && is_array($_POST[“guestfirst”]) )
        around each foreach loop and that fixed the issue.

    1. You don’t have to enable RSVPs for every event.

      Or do you mean you want to collect responses but just assume that if they’re responding it’s a yes? You’d have to override the event_content($content) filter function in rsvpmaker-plugabble.php (see advanced customization documentation)

  2. Hey David,
    Is there any way I can make the First name, Last name and Email fields as required fields in the RSVP Form?
    If yes, how to achieve that?

    Any help would be grateful!
    Thanks!

  3. How can I expand the data fields (first name, last name, etc.) so responders can see everything they are typing in? Right now the fields only show 5 or 6 characters.

  4. Hi – the plugin is great, but I’m having some trouble customizing. I’d like to remove the phone number field. I did this in the RSVP form in the admin, and then took out instances in the PHP files. The phone field stills appears, however.

  5. Hi. Great plugin.
    Can I include a button or checkbox type fields in the form by editing the RSVP From field?
    This will be used by different users. I can spend some time teaching them how to use the shortcodes in the field, but not how to edit a php file.

  6. I’m having a problem with the RSVP functionality. Every time I hit the RSVP on the actual events page I get a 404 error message Something went wrong/Page not found.
    I’ve added the rsvpmaker_upcoming shortcode on my events page of course, just dont know if I need to add another shortcode (which one?) somewhere else in my wp…

    Any help is MUCH appreciated!

    K

    1. Sorry to be slow to respond. This seems to be a problem with certain configurations and not others. I just put out a new release that uses a different wordpress function to generate the permalink to an event page – according to the documentation it may work better. It’s hard to debug because I’ve never seen this particular error on the sites I manage.

    1. I tested for this and cannot reproduce the problem. My guess is that you may have made some other change to the form, perhaps to the html content that is causing the submit button to be hidden or aligned improperly so that you’re not seeing it. If you can send me a link to a sample event that has this problem, I might be able to give more specific advice.

  7. Would it be possible to add a captcha or something similar (like “what’s 5+5?”) to the RSVP form, to help stop trolls from adding their info as RSVPs to your event? My website has been getting quite a lot of spam RSVPs lately and I was thinking this might be a really nice feature to add to the basic RSVP form? Please let me know what you think or any suggestions you may have?

  8. I would like to customize the first and last name fields in a different way from the email field. For example, I want to have the email address field twice as long as the first and last name fields so that I can put the first and last name fields on the same line.

    I’ve also removed the labels outside the first and last name fields, and I want to add placeholder text inside the fields themselves. Any way I can do this?

  9. Hi there. I’m wondering if it’s possible to change the text that says “RSVP Now!” at the beginning of the RSVP form. I’ve looked through the templates and don’t see any code where it’s possible to change that text. In my case, it will be better to say, “register now”. Thanks!

    1. Solved!

      Plugins >> editor >> select “RSVPmaker” in the upper right hand corner >> select “rsvpmaker-plugabble.php” on the right >> change…

      to read

  10. Hi, I have added some custom fields to the form but when I pull a report on that event’s RSVP, the custom fields do not show up. Am I doing something wrong? I want a drop down where they indicate an RSVP for # of adults and kids for food.

  11. I need all my radio button options to appear in the same line, side by side, but no matter what I try (such as the div suggestion above, and adding sep=” ” ) a line break is still inserted and my options appear one above the other. Any suggestions?

  12. How can I remove “Posted by Admin on Date” below the RSVP Now! button? I would also like to remove the calendar icons. Lastly, I how do I change the color and text of the RSVP Now! button? Any guidance you would provide is appreciated. Thanks!

    1. You can remove the posted by / date info by adding hideauthor=”1″ to the rsvpmaker_upcoming shortcode: [rsvpmaker_upcoming hideauthor="1"]

      Display of the calendar icons is a default that can be changed on the RSVPMaker settings screen. Also from that screen, you can alter the styling of the RSVPMaker button using inline CSS.

  13. I love this plugin! I wondered if we could customize the YES and NO text to something we specify? Also where would we add styling code like Background color and Text Color? thanks in advance!

    1. The YES/NO text is not easily customizable. Maybe I’ll change that in a future release.

      The styling and text of the RSVP Now! button can be changed with inline css and is accessible through the RSVPMaker options screen. There’s also an option for specifying a different CSS stylesheet to be loaded on pages where event content is displayed.

      1. Thanks for the tips on Styling the Send Button. Is there a similar space to edit the style of the Event Form Page itself? Ideally id like to change the background color of the individual page. Also is it possible to hide or style the Event Title or Date?

        1. You can have a custom stylesheet that gets loaded on all RSVPMaker posts. You’ll need to upload it to your web server and then include the URL in the appropriate spot in the RSVPMaker settings screen. If you need to apply a different style to one particular event post/form, rather than all of them, that’s not currently possible.

          To hide the title and the date, you would set

          h1.entry-title {display: none}
          div.dateblock {display: none}

          Curious why you would want to do that, but yes it should be possible.

  14. Hello, I love this RSVP plugin, but I would love to just use the form portion of it. Is there a way to shortcode just the register information so I can place this form within another WP page? I feel like I am limited in how good I can make this page look and some of the information on the “post” page that it appears on is not needed.

  15. Thanks for your help! I have another question: how can you display the RSVP events other than in one column? I have 6 events and they take up a lot of room on the page only being one column and multiple rows. Is there a way to display the events in a smaller block and perhaps side by side so that I have essentially two columns and three rows? Thank you in advance; I truly appreciate the guidance.

    1. 2 thoughts: If you have some PHP coding skills, you can create a shortcode of your own to use in place of rsvpmaker_upcoming that outputs the content differently.

      Second, you could override the default CSS file included with RSVPMaker (there is a place on the settings screen where you can specify your own stylesheet to be used instead). To divide the events into columns, you could do something like this:

      div.rsvpmaker {
      width: 45%;
      float: left;
      padding-left: 5px;
      }

      Note: I tried the code above on this site and wasn’t entirely happy with the results. But if you’re a better CSS coder than I am, I’d love to see what you do with it. If you want your site to look good on mobile devices, you would want to include some responsive code so the two columns reformat into one on small screens.

      1. Here is the event page from this site in a 2-column layout using the CSS shared above. Some glitches that would have to be fixed include the crowding of images aligned right to text and the More Events link showing up on the side rather than the bottom.

  16. Dear David,
    I’m not sure here is the right place to report bugs but I just noticed since last update an issue showed up:
    The Additional Guest form is not working properly. I had set the Email field to show up in Guest section and it was working perfectly but now suddenly it has disappeared.
    Here is the code I was using for the form:
    ————————————————————
    First Name:* [rsvpfield textfield="first" required="1"]
    Last Name:* [rsvpfield textfield="last" required="1"]
    Phone: [rsvpfield textfield="Phone" size="20" ]
    Account Manager: [rsvpfield selectfield="Account_Manager" options="Select your account manager,Benzi Mathews,Jackie Wong,Kristen Pietrobon/Sami Sawant,Marsha Fingold,Matia Zarghami,Sri Simon,Tony Mifsud,Van Garabet,Don't Know" required="1"]
    Email:* [rsvpfield textfield="email" required="1" guestfield="1"]
    Company Name: [rsvpfield textfield="Company_Name" required="0" guestfield="1"]
    [rsvpguests]
    Note:
    [rsvpnote]
    —————————————————————————————–
    By the way your plugin is the best! 🙂
    Ben/Mohsen

          1. Hi David,
            That’s it, Like water on fire! 🙂
            It’s working perfectly!
            Thanks a lot,
            Keep on the good work!,
            Ben

Leave a Reply