隐藏输入按钮 [英] Hide input button
问题描述
以下是我的代码: http://jsfiddle.net/Draven/rEPXM/23/
我想知道如何隐藏添加提交按钮,直到我点击 + kbd> image将输入框添加到表单中。 我不想在输入框旁边添加提交按钮,因为我希望能够添加多个输入框并在点击添加时提交。 jQuery ID,并使其开始隐藏 然后使用 Here is the code I have: http://jsfiddle.net/Draven/rEPXM/23/ I'd like to know how I can hide that Add submit button until I click the + image to add input boxes to the form. I don't want to add the submit button next to the input box because I want to be able to add multiple input boxes and submit them all when I click Add. HTML jQuery
Just give the button an ID, and make it start hidden Then use the 这篇关于隐藏输入按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ b HTML
$ b
< div id =left>
< div class =box>
< div class =boxtitle>< span class =boxtitleleftgap>& nbsp;< / span>< span class =boxtitlebulk>< span class =boxtitletext >文件夹< / span>< div style =float:right; margin-top:4px;>< a href =#onclick =javascript:AddFolder();>< div类= addplus >&安培; NBSP;< / DIV>< / A>< / DIV>< /跨度>< / DIV>
< div class =boxcontent>
< form method =postid =folderformaction =page.php?action = list-volunteer-appsname =folderform>
< / a>< a class =evenhref =page.php?action = list-volunteer-apps& folder = 1>文件夹1< span class =text>( 0)< /跨度>< / A>
< div id =foldercontainer>< input type =submitvalue =Add>< / div>
< / form>
< / div>
< / div>
< / div>
函数AddFolder(){
$('#foldercontainer')。append('< input name =folder []type =textsize =20 />');
}
< input type =submitid =addButtonvalue =Addstyle =display:none;>
show()
jQuery方法:
$(#addButton)。show();
<div id="left">
<div class="box">
<div class="boxtitle"><span class="boxtitleleftgap"> </span><span class="boxtitlebulk"><span class="boxtitletext">Folders</span><div style="float: right; margin-top: 4px;"><a href="#" onclick="javascript: AddFolder();"><div class="addplus"> </div></a></div></span></div>
<div class="boxcontent">
<form method="post" id="folderform" action="page.php?action=list-volunteer-apps" name="folderform">
<a class="even" href="page.php?action=list-volunteer-apps&folder=2">Folder 2 <span class="text">(1)</span></a><a class="even" href="page.php?action=list-volunteer-apps&folder=1">Folder 1 <span class="text">(0)</span></a>
<div id="foldercontainer"><input type="submit" value="Add"></div>
</form>
</div>
</div>
</div>
function AddFolder() {
$('#foldercontainer').append('<input name="folder[]" type="text" size="20" />');
}
<input type="submit" id="addButton" value="Add" style="display: none;">
show()
jQuery method:$("#addButton").show();