Php 按下按钮时显示隐藏的div内容
嗨,伙计们?如何在按下按钮之前隐藏div内容?。有人能帮我吗?我希望这个div在按下表中的“添加新教师”按钮之前不要出现。这是div的内容,我希望它被隐藏,直到按下按钮Php 按下按钮时显示隐藏的div内容,php,jquery,Php,Jquery,嗨,伙计们?如何在按下按钮之前隐藏div内容?。有人能帮我吗?我希望这个div在按下表中的“添加新教师”按钮之前不要出现。这是div的内容,我希望它被隐藏,直到按下按钮 <div id="myform"> <p align="center"> <strong> Add information for new teacher here </strong></p> <form action="<?php echo $e
<div id="myform">
<p align="center">
<strong>
Add information for new teacher here
</strong></p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center" id="forms">
<tr valign="baseline">
<td nowrap="nowrap" align="right">First name:</td>
<td><input type="text" name="first_name" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Last name:</td>
<td><input type="text" name="last_name" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Subjects:</td>
<td><input type="text" name="subjects" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Phonenumber:</td>
<td><input type="text" name="phonenumber" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Email:</td>
<td><input type="text" name="email" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Username:</td>
<td><input type="text" name="username" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Password:</td>
<td><input type="text" name="password" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Insert record" id="hideit"/></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
</div>
在此处添加新教师的信息
将display:none
样式添加到您的div中,然后调用$(“#div id”).show()代码>点击按钮
<div id="myform" style="display:none">
// contents here
</div>
//这里的内容
将display:none
样式添加到您的div中,然后调用$(“#div id”).show()代码>点击按钮
<div id="myform" style="display:none">
// contents here
</div>
//这里的内容
像这样试试看
$(function(){
$('button#showit').on('click',function(){
$('#myform').show();
});
});
开始时div
应该是隐藏的
<div id="myform" style="display:none">
.....
.....
像这样试试看
$(function(){
$('button#showit').on('click',function(){
$('#myform').show();
});
});
开始时div
应该是隐藏的
<div id="myform" style="display:none">
.....
.....
您可以使用jQuery隐藏和显示函数
这里
您可以使用jQuery隐藏和显示函数
这里
在新教师窗体上添加内嵌样式以隐藏窗体
<div id="myform" style="display:none">
在新教师窗体上添加内嵌样式以隐藏窗体
<div id="myform" style="display:none">
在代码中进行以下更改:
<div id="myform" style="display:none;">
在代码中进行以下更改:
<div id="myform" style="display:none;">
$(函数(){
$('.button_name')。单击(函数(){
$('#myform').show();
});
});
或者使用java脚本
function new_disp(){
document.getElementById('myform').style.display='block';
}
<button onclick='new_disp();'>
<div id="myform" style="display:none">
函数新建_disp(){
document.getElementById('myform').style.display='block';
}
$(函数(){
$('.button_name')。单击(函数(){
$('#myform').show();
});
});
或者使用java脚本
function new_disp(){
document.getElementById('myform').style.display='block';
}
<button onclick='new_disp();'>
<div id="myform" style="display:none">
函数新建_disp(){
document.getElementById('myform').style.display='block';
}
你试过什么吗?可能是重复的问题。你试过什么吗?可能是重复的问题。非常感谢。我完全按照你说的做了,它的工作就像我需要的一样。谢谢你。。我完全按照你说的做了,它的工作就像我需要的一样。谢谢