<p class="<?php if (get_option('jr_submit_cat_required')!=='yes') : echo 'optional'; endif; ?>"><label for="job_cat"><?php _e('Job Category', 'appthemes'); ?> <?php if (get_option('jr_submit_cat_required')=='yes') : ?><span title="required">*</span><?php endif; ?></label> <?php
$sel = 0;
if (isset($posted['job_term_cat']) && $posted['job_term_cat']>0) $sel = $posted['job_term_cat'];
global $featured_job_cat_id;
$args = array(
'orderby' => 'name',
'exclude' => $featured_job_cat_id,
'order' => 'ASC',
'name' => 'job_term_cat',
'hierarchical' => 1,
'echo' => 0,
'class' => 'job_cat',
'selected' => $sel,
'taxonomy' => 'job_cat',
'hide_empty' => false
);
$dropdown = wp_dropdown_categories( $args );
$dropdown = str_replace('class=\'job_cat\' >','class=\'job_cat\' ><option value="">'.__('Select a category…', 'appthemes').'</option>',$dropdown);
echo $dropdown;
?></p>
我尝试插入 onchange="changeValue();
此选择字段,但找不到该字段!然而,代码实际上在表单中生成了一个选择字段。
请帮我找出原因。