|
@@ -31,9 +31,14 @@
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <input type="text" name="fil" width="1000px">
|
|
|
- <a data-file data-type="png,jpg,jpeg" data-field="mut">上传文件</a>
|
|
|
-
|
|
|
+ <tr>
|
|
|
+ <td width="10%" class="infoBoxTd"><div style="width:55px;">话题<br />(<a href="#" id="AddMoreFileBox" style="color: red" class="btn btn-info">添加</a>):</div></td>
|
|
|
+ <td colspan="2" id="InputsWrapper">
|
|
|
+ <volist name="t" id="l" key="i">
|
|
|
+ <span><input type="text" name="mytext[]" id="field_{$i}" value="{$l.title}" style="width:400px;"/><a href="#" class="removeclass">×</a> </span>
|
|
|
+ </volist>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
|
|
|
|
|
|
|
|
@@ -60,6 +65,38 @@
|
|
|
require(['ckeditor'], function () {
|
|
|
window.createEditor('[name=content]', {height: 350})
|
|
|
});
|
|
|
+
|
|
|
+ $(document).ready(function() {
|
|
|
+
|
|
|
+ var MaxInputs = 100;
|
|
|
+ var InputsWrapper = $("#InputsWrapper");
|
|
|
+ var AddButton = $("#AddMoreFileBox");
|
|
|
+
|
|
|
+ var x = InputsWrapper.length;
|
|
|
+ var FieldCount=1;
|
|
|
+
|
|
|
+ $(AddButton).click(function (e)
|
|
|
+ {
|
|
|
+ if(x <= MaxInputs)
|
|
|
+ {
|
|
|
+ FieldCount++;
|
|
|
+ //add input box
|
|
|
+ $(InputsWrapper).append('<span><input type="text" name="mytext[]" id="field_'+ FieldCount +'" value="" style="width:400px;"/><a href="#" class="removeclass">×</a> </span>');
|
|
|
+ x++; //text box increment
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ $("body").on("click",".removeclass", function(e){
|
|
|
+ if( x > 0 ) {
|
|
|
+ $(this).parent('span').remove(); //remove text box
|
|
|
+ x--;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ })
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
layui.use(['upload', 'element', 'layer'], function() {
|
|
|
var $ = layui.jquery
|
|
|
, upload = layui.upload
|