Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 选中复选框时如何显示Div_Python_Html_Django - Fatal编程技术网

Python 选中复选框时如何显示Div

Python 选中复选框时如何显示Div,python,html,django,Python,Html,Django,选中复选框后,我想显示隐藏的div。当前,选中该复选框后,div将保持隐藏状态。可能是div的嵌套结构导致了问题 page.html <div class="field"> <label class="label">Opportunity Information:</label> <div class="field">

选中复选框后,我想显示隐藏的div。当前,选中该复选框后,div将保持隐藏状态。可能是div的嵌套结构导致了问题

page.html

                <div class="field">
                    <label class="label">Opportunity Information:</label>
                    <div class="field">
                        <div class="control">
                            <label class="checkbox">
                                <input type="checkbox" name="ware_type" id="ware_type" onchange="showHiddenField()">Hardware/Software:</a>
                            </label>
                        </div>
                    </div>
                    <div class="field">
                        <div class="field">
                            <input class="input" name="estimate_id" id="estimate_id" type="text" placeholder="Estimate ID" style="display: none;">
                        </div>
                    </div>
                </div>
你可以改变

<input type="checkbox" name="ware_type" id="ware_type" onchange="showHiddenField()">Hardware/Software:</a>
你可以改变

<input type="checkbox" name="ware_type" id="ware_type" onchange="showHiddenField()">Hardware/Software:</a>

您认为
currentObject
来自何处?另外,如果您希望它成为复选框,则父对象是标签;您需要
parent();所以它必须是
parent().parent().parent().next().find('input')
@DanielRoseman那么currentObject应该是什么呢?复选框id?您认为
currentObject
来自哪里?另外,如果您打算将其作为复选框,则父项是标签;您需要
parent();所以它必须是
parent().parent().parent().next().find('input')
@DanielRoseman那么currentObject应该是什么呢?复选框id?
<input type="checkbox" name="ware_type" id="ware_type" onchange="showHiddenField(this,'#estimate_id')">Hardware/Software:
function showHiddenField(e,t) {
  $(t).toggle($(e).is(":checked"));
}