WordPress.org

Ready to get started?Download WordPress

Forums

RSVPmaker
Minor bug in Guest registration (5 posts)

  1. lgabercrombie
    Member
    Posted 2 years ago #

    When you add guests after the 2nd one, clicking on "+Add guests" opens up several form boxes for guest. This gets worse as you continue to add guests, opening several new boxes and confusing the users. However, it seems to end up with the guest entries (I had one with 10 guests which seems OK).

    http://wordpress.org/extend/plugins/rsvpmaker/

  2. soaringthor
    Member
    Posted 1 year ago #

    From rsvpmaker-pluggable.php:

    <!-- guest section -->
            <p id="guest_section"><strong><?php echo __('Guests','rsvpmaker');?>:</strong> <?php echo __('If you are bringing guests, please enter their names here','rsvpmaker');?></p>
            <?php echo $guestedit;?>
            <div class="guest_blank"><?php echo __('First Name','rsvpmaker');?>: <input type="text" name="guestfirst[]" style="width:30%" /> <?php echo __('Last Name','rsvpmaker');?>: <input type="text" name="guestlast[]" style="width:30%" /><input type="hidden" name="guestid[]" value="0" /></div>
            <a href="#guest_section" id="add_guests" name="add_guests">(+) <?php echo __('Add more guests','rsvpmaker');?></a></p>
    <script>
    jQuery(document).ready(function($) {
    
    $('#add_guests').click(function(){
    	$('.guest_blank').append('<div class="guest_blank">First Name: <input type="text" name="guestfirst[]" style="width:30%" /> Last Name: <input type="text" name="guestlast[]" style="width:30%"/><input type="hidden" name="guestid[]" value="0" /></div>');
    	});
    });
    </script>
    <!-- end of guest section-->

    So... the first guest entry has an id of guest_blank. When you click the (+) Add more guests link, a script runs to append the guest_blank area with a new guest line. But this new guest line also has an id of guest_blank. So, if you click the (+) link again, there are now two lines with the id of guest_blank, and so the script is going to append a new guest line to each existing line, making a total of 4 lines. Now there are 4 lines with the id guest_blank, so clicking the (+) link again will add 4 more lines.

    I made the following change to my rsvpmaker-pluggable.php:

    <!-- guest section -->
            <p id="guest_section"><strong><?php echo __('Guests','rsvpmaker');?>:</strong> <?php echo __('If you are bringing guests, please enter their names here','rsvpmaker');?></p>
            <?php echo $guestedit;?>
            <div class="guest_blank"><?php echo __('First Name','rsvpmaker');?>: <input type="text" name="guestfirst[]" style="width:30%" /> <?php echo __('Last Name','rsvpmaker');?>: <input type="text" name="guestlast[]" style="width:30%" /><input type="hidden" name="guestid[]" value="0" /></div><div class="add_one"></div>
            <a href="#guest_section" id="add_guests" name="add_guests">(+) <?php echo __('Add more guests','rsvpmaker');?></a></p>
    <script>
    jQuery(document).ready(function($) {
    
    $('#add_guests').click(function(){
    	$('.add_one').append('<div class="guest_blank">First Name: <input type="text" name="guestfirst[]" style="width:30%" /> Last Name: <input type="text" name="guestlast[]" style="width:30%"/><input type="hidden" name="guestid[]" value="0" /></div>');
    	});
    });
    </script>
    <!-- end of guest section-->

    After the guest_blank div tags, I added an empty <div class="add_one"></div>, then modified the script so that it appends the guest line to that add_one rather than the guest_blank. Since the new guest line doesn't include an add_one div, there's only ever one add_one div in the page, which means only one line gets added at a time.

    Hope that makes sense... I'm also unsure if this change is going to be annulled when the plugin is updated - but I may not ever update the plugin.

  3. davidfcarr
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for sharing this. I'm working on an update now and will try to get this incorporated.

  4. tdbarnes
    Member
    Posted 1 year ago #

    I am unable to acquire any additional guest lines. I've added the new script to rsvpmaker-plugabble.php and it didn't work either. I've also tried the script from the test page, but no joy. The link to my RSVP page is 'http://nvahof.org/?rsvpmaker=rsvp-2012-nvahof-induction-dinner-ceremony'
    Thanks for a great plugin.

  5. davidfcarr
    Member
    Plugin Author

    Posted 1 year ago #

    The HTML and JavaScript for that guest section has been updated in version 2.5.3

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags