我有一个div与<a href="#modal">
里面。到目前为止,模态通常打开。 问题在于它的内部形式。当我将它复制到另一个页面时,表单起作用,但我不知道为什么它在模式内不起作用。 下面是代码:窗体内的模态框
<div class="remodal" data-remodal-id="modal">
<h1>Crear nueva entrada</h1>
<p>
Debes contarnos un poco más sobre lo que quieres escribir antes de empezar.
</p>
<form action="newpost.php" method="post">
<table style="width:100%">
<tbody>
<tr>
<th>
Categoría
<?php
class Top_level_Optgroup extends Walker_CategoryDropdown {
var $optgroup = false;
function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0) {
$pad = str_repeat(' ', $depth * 3);
$cat_name = apply_filters('list_cats', $category->name, $category);
if (0 == $depth) {
// $this->optgroup = true;
$output .= "<optgroup class=\"level-$depth\" label=\"".$cat_name."\" >";
} else {
$output .= "<option class=\"level-$depth\" value=\"".$category->term_id."\"";
if ($category->term_id == $args['selected'])
$output .= ' selected="selected"';
$output .= '>';
$output .= $pad.$cat_name;
if ($args['show_count'])
$output .= ' ('. $category->count .')';
$output .= "</option>";
}
}
function end_el(&$output,$object,$depth) {
if (0 == $depth/* && true == $this->optgroup*/) {
$output .= '</optgroup>';
}
}
}
// usage
wp_dropdown_categories(
array(
'orderby' => 'name',
'hide_empty' => 0,
'show_option_none' => 'Selecciona una',
'class' => 'cat',
'hierarchical' => 1,
'name' => 'cat',
'exclude' => '1',
'walker' => new Top_level_Optgroup
)
);
?>
</th>
<th>Fuente<input type="text" name="source" id="source" placeholder="http://">
<br><input type="checkbox" name="own" value="own" onclick="document.getElementById('source').disabled=this.checked;"> Es propia</th>
</tr>
</tbody>
</table>
<br>
<input class="remodal-cancel" value="Cancelar">
<input type="submit" class="remodal-confirm" value="¡Vamos allá!">
</form>
</div>
我使用下面的脚本,如果你需要它:Remodal
定义“不起作用”。标记是否以某种方式变化?有错误吗?怎么了?只要标记有效,标记中的任何'form'元素都应该“正常工作”。 (注意:你的代码是非常奇怪的组织,这可能会让调试/支持变得困难,你正在定义一个*在渲染输出中间*。通常你应该自己定义类并提供输出。 ) – David 2014-09-22 16:15:44
它没有做任何事情:它不重定向既不关闭模式(我修改了脚本)。对不起,如果代码组织糟糕,我是这个世界的新人,我正在学习。我复制其他代码的摘录,也许这就是为什么它组织糟糕。 – mbelis 2014-09-22 16:23:53
那么,对于初学者来说,你需要检查你的*客户端*代码,看看它是否按照你期望的方式构建。现在你正在显示服务器端代码,这对客户端功能没什么影响。 – David 2014-09-22 16:28:58