Skip Navigation

[Escalated to 2nd Tier] Toolset forms with same ID in a View with infinite scroll

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 8 replies, has 4 voices.

Last updated by Minesh 2 months, 3 weeks ago.

Assigned support staff: Minesh.

Author
Posts
#1787277

Hi, I've an Edit form for CPT Trainers with AJAX submit. I've built a View where I list all the Trainers with an edit form for each one of them. I've activated infinite scroll.

When I scroll down and the page loads more Trainers and forms, the forms submit stops working.

I found that the infinite scroll start again the numbering of the form ID, so I have on the page more then one <form id="cred_form_745_1">. I think that is the problem.

You can check it on my website on this page:

/trainers-edit/

This is the View:

/wp-admin/admin.php?page=views-editor&view_id=746

This is the Form:

/wp-admin/post.php?post=745&action=edit

cheers

#1788427

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - I can see the issue on my local test install.

Please allow me to report this issue to our next level support.

Please hold on for further updates.

#1792061

I've struggled with this bug for quite some time. It forces me to abandon infinite scrolling. If only there was a way to not have the IDs reset, it would enable amazing functionality possibilities.

thanks for finding a solution.

marc

#1833415

Hi, is there any news about this issue?

Thanks

#1833421

Nigel
Supporter

Languages: English (English ) Spanish (EspaƱol )

Timezone: Europe/London (GMT+01:00)

Sorry, nothing yet. It is on the development board but didn't make it into the sprint we are just closing for testing which should be out soon, so any fix will be a while yet I'm afraid.

#1836291

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Changing the status of ticket.

#1837095

I would be willing to pay a premium for this bug to be fixed. I have a site that is on hold while this gets sorted. I've built a social media status update page that loads many CPTs with the ability for users to add comments, like/dislike, etc each post... as you can imagine, lots of CRED forms are in use. Infinite scroll is an important feature for a social media status feed and unfortunately the resetting of form IDs kills the functionality.

praying for a fix! but I've got cash in hand to help it along.

thanks

marc

#1913001

Hi, is there any workaround for this issue?

For example, is it possible to use this frontend event to fix the Forms IDs:

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.effect (string) The View AJAX pagination effect
	* data.speed (integer) The View AJAX pagination speed in miliseconds
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
	
});
#1913031

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see there is no workaround offered by Devs yet.

Yes, you can regenerate the IDs of the form using the code as given under:


jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.effect (string) The View AJAX pagination effect
    * data.speed (integer) The View AJAX pagination speed in miliseconds
    * data.layout (object) The jQuery object for the View layout wrapper
    */
  	i = 0;
    jQuery(".js-wpv-view-layout form").each(function(){
       	newID = 'cred_form_745_'+ i++;
      	jQuery(this).attr("id",newID);
    });
     
});

But, it will have other site effects of displaying the messages and all. Each element (intput,submit etc..etcc) is bind with the form ID prefix so its really hard to control everything by just chaning the form IDs. And again it will be a workaround and may get broken at any time so I suggest to wait for official fix.