2

这是代码....

<?php
if (!defined('IPHORM_VERSION')) exit;
if (!isset($element['logic'])) $element['logic'] = false;
?>
<tr valign="top">
<th scope="row">
<label for="prevent_duplicates_<?php echo $id; ?>"><?php esc_html_e('Enable conditional logic', 'iphorm'); ?></label>
</th>
<td>
<input type="checkbox" id="logic_<?php echo $id; ?>" name="logic_<?php echo $id; ?>" <?php checked(true, $element['logic']); ?> onclick="iPhorm.toggleLogic(iPhorm.getElementById(<?php echo $id; ?>));" />
<p class="description">
<?php
if ($element['type'] == 'groupstart') {
esc_html_e('Enables you to create rules to show or hide this group depending on the values of other fields', 'iphorm');
} else {
esc_html_e('Enables you to create rules to show or hide this field depending on the values of other fields', 'iphorm');
}
?>
</p>
</td>
</tr>
<?php
if (!isset($element['logic_action'])) $element['logic_action'] = 'show';
if (!isset($element['logic_match'])) $element['logic_match'] = 'all';
if (!isset($element['logic_rules'])) $element['logic_rules'] = array();
?>
<tr valign="top" class="ifb-show-if-logic-on <?php if (!$element['logic']) echo 'ifb-hidden'; ?>">
<th scope="row">
<label><?php esc_html_e('Logic rules', 'iphorm'); ?></label>
</th>
<td>
<div id="ifb_logic_rules_<?php echo $id; ?>"></div>
</td>
</tr>   
4

1 回答 1

1

创建 toggleLogic() javascript 函数并放置您的弹出框代码并检查您的逻辑以显示内容。

像这样。

function toggleLogic(someid)
{
 // your logic code
    ...
}
于 2013-09-13T05:39:34.427 回答