Forum

Login form protected by Login LockDown.


The forum has been shut down and all support will now go through the Help Desk

 
You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Problem using conditional logic across page breaks (Bug?)

UserPost

2:42 pm
September 5, 2010


Nathaniel Colangelo

posts 2

1

Hi.  I just purchased the Pro version yesterday, and I love it!  :)

 

I have encountered a problem trying to create a multi-page form that uses conditional logic based on values the user sets on page #1 to determine what shows up on page #2.

 

The problem is that the items on page #2 simply don't show up… ever. No mater what values the user chooses, the dependant items never show up.

 

This is definitely connected to multi-page because if I remove the page breaks then the conditional logic *does* work (i.e., the dependant controls appear and disappear as expected when the user chooses different values).

 

Question 1: Is the conditional logic features supposed to be compatible with use across page breaks?

 

Question 2: If so, how do I get it to work?

 

Thank you!

Nathaniel

415-456-6136

11:12 am
September 6, 2010


Stephanie Wells

posts 2507

2

What type of field is it that you are using on page 1 that the page 2 field should be checking for?

11:27 am
September 6, 2010


Nathaniel Colangelo

posts 2

3

Stephanie,

Thanks for getting back to me (on a holiday!)  :)

 

I am using a radio button control on page one to control the field on page 2.

 

Regards,
Nathaniel

12:10 pm
September 6, 2010


Stephanie Wells

posts 2507

4

Hehe, no problem.

Here's a temporary fix:

Open formidable/pro/classes/views/frmpro-fields/show-radio-js.php

Change line 5 from:

if($("input[name='item_meta[<?php echo $observed_field->id ?>]']:checked").val() == '<?php echo $field["hide_opt"]?>')

to:

if($("input[name='item_meta[<?php echo $observed_field->id ?>]']:checked").val()=='<?php echo $field["hide_opt"]?>' || ($("input:hidden[name='item_meta[<?php echo $observed_field->id ?>]']").val()=='<?php echo $field["hide_opt"]?>'))

1:19 pm
September 6, 2010


Nathaniel Colangelo

posts 2

5

Thanks, that did the trick!

 

Another question: The Section Heading field type does not offer the option to conditionally hide it.  Would it be difficult to add that option?

 

The reason is that I'm creating a kind of "branching" multi-page form where the content of later pages depends on the input from prior pages.  I'm using the section heading to give the user instructions and I need to hide/show those headings to correspond to the selections they made on the earlier pages.

 

Kind Regards, and thanks again for the great product! :)

6:36 pm
September 11, 2010


Stephanie Wells

posts 2507

6

I'm not seeing an easy way to add the option at the moment. However, you could probably add a little javascript to the end of the editable HTML for the section header field. You'll also need to add an ID in the HTML for the section. The HTML for that field could look something like this:

<div id="hide_this_section">

<h2 class="frm_pos_[label_position][collapse_class]">[field_name]</h2>
[collapse_this]
[if description]<p class="description">[description]</p>[/if description]

</div>

And the Javascript:

<script type="text/javascript">

jQuery(document).ready(function($){

$('#hide_this_section').hide();

if($("input:hidden[name='item_meta[FIELDIDHERE]']").val()=='value it should equal')

    $('#hide_this_section').show();

})

</script>

 

Here's what you will need to change:

1. "hide_this_section" should be changed in both the HTML and the javascript. Make sure you change them both to the same thing.

2. Replace FIELDIDHERE with the ID of the field you would like the section header to watch for.

3. Replace 'value it should equal' with whatever the value of that field should be in order to show that section.

 

NOTE: This will hide not only the section header, but also everything inside of it.