Tagged: conditions, scope
- This topic has 3 replies, 2 voices, and was last updated 6 years ago by
jivedig.
Viewing 3 reply threads
-
AuthorPosts
-
-
January 23, 2016 at 5:48 pm #5700
jivedigMemberI am trying to implement conditional fields on a front end form. I have it working, but only when both field’s scope is the same. We should be able to have a different scope while still allowing conditional fields.
Here are the 2 fields i’m using. Change the scope to the same and it will work.
piklist('field', array( 'type' => 'radio', 'scope' => 'post', 'field' => 'post_status', 'label' => 'When would you like to post this?', 'value' => 'publish', 'choices' => array( 'publish' => 'Immediately', 'future' => 'Schedule a future date', ), )); piklist('field', array( 'type' => 'datepicker', 'scope' => 'post_meta', 'field' => 'post_date', 'label' => 'Scheduled Post Date', 'columns' => 2, 'options' => array( 'dateFormat' => 'm-d-y', 'firstDay' => '1', ), 'validate' => array( array( 'type' => 'today_or_future', ), ), 'conditions' => array( array( 'field' => 'post_status', 'value' => 'future', ), ), )); -
January 23, 2016 at 5:56 pm #5701
jivedigMemberInteresting update…
I can add the scope to the conditions array and now it works.
'conditions' => array( array( 'scope' => 'post', 'field' => 'post_status', 'value' => 'future', ), ), -
January 23, 2016 at 10:48 pm #5703
-
January 23, 2016 at 10:58 pm #5704
jivedigMemberThanks, I realize how important it is for the fields themselves, but didn’t realize it mattered for the conditions themselves. Thanks 😉
-
-
AuthorPosts
Viewing 3 reply threads
- The topic ‘Conditional fields not working when scope is different’ is closed to new replies.