Randomize Page-Breaks

By: Peter S | Asked: 11/29/2024
ForumsCategory: General questionsRandomize Page-Breaks
Peter S asked 5 days ago

Hi, 

Formidable has a code to randomise the order of fields but I want it to instead randomize the order of my page-breaks and not the fields.

Here is their code:

add_filter( 'frm_get_paged_fields', 'randomize_form_fields', 20, 2 ); function randomize_form_fields( $fields, $form_id ){ if ( $form_id == 25 ) { //change 25 to the id of the form to change shuffle( $fields ); } return $fields; }

I know there is randomize function for the quizzies which I don't want to use. 

Thanks!

1 Answers
Rob LeVineRob LeVine answered 5 days ago
Looking at the Formidable code, I don't see a way to do that without overriding the code and I'm not even sure that will work. One major problem is that the page break are just their own fields, it's not like the fields within the page break know which page they belong to. I guess you could try to use custom code to modify the field_order column for each field when you display the form and then change it back afterward? Maybe somebody has a better idea.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right