Showing
1 changed file
with
37 additions
and
0 deletions
@@ -69,6 +69,7 @@ | @@ -69,6 +69,7 @@ | ||
69 | <td> | 69 | <td> |
70 | <span style="color:red">*</span><label>文字内容</label> <br> | 70 | <span style="color:red">*</span><label>文字内容</label> <br> |
71 | <textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="请在这里输入1-500字的笔记" required="" maxlength="500"></textarea> | 71 | <textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="请在这里输入1-500字的笔记" required="" maxlength="500"></textarea> |
72 | + <span id="content-count">0</span>/500 | ||
72 | </td> | 73 | </td> |
73 | </tr> | 74 | </tr> |
74 | 75 | ||
@@ -181,6 +182,15 @@ | @@ -181,6 +182,15 @@ | ||
181 | } | 182 | } |
182 | }); | 183 | }); |
183 | 184 | ||
185 | + /*字数限制*/ | ||
186 | + $("#content").on("input propertychange", function() { | ||
187 | + debugger | ||
188 | + var $this = $(this); | ||
189 | + var count = $this.val().length; | ||
190 | + $("#content-count").text(count); | ||
191 | + }); | ||
192 | + | ||
193 | + | ||
184 | $("#labelId").combobox({ | 194 | $("#labelId").combobox({ |
185 | prompt: "请选择标签", | 195 | prompt: "请选择标签", |
186 | required: false, | 196 | required: false, |
@@ -316,6 +326,20 @@ | @@ -316,6 +326,20 @@ | ||
316 | bucket: "grassImg" | 326 | bucket: "grassImg" |
317 | }, | 327 | }, |
318 | onBeforeSubmit: function () { | 328 | onBeforeSubmit: function () { |
329 | + debugger; | ||
330 | + var oobj = $(this).find("input[type='file']"); | ||
331 | + var files = oobj[0].files; | ||
332 | + | ||
333 | + for(var i=0; i<files.length;i++){ | ||
334 | + var obj = files[i]; | ||
335 | + if(obj!=null && obj!=''){ | ||
336 | + if(obj.type.toLowerCase() == 'image/png'){ | ||
337 | + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;}); | ||
338 | + return false; | ||
339 | + } | ||
340 | + } | ||
341 | + } | ||
342 | + | ||
319 | $.messager.progress({ | 343 | $.messager.progress({ |
320 | title: "正在执行", | 344 | title: "正在执行", |
321 | msg: "正在执行,请稍后...", | 345 | msg: "正在执行,请稍后...", |
@@ -427,6 +451,19 @@ | @@ -427,6 +451,19 @@ | ||
427 | bucket: "grassImg" | 451 | bucket: "grassImg" |
428 | }, | 452 | }, |
429 | onBeforeSubmit: function () { | 453 | onBeforeSubmit: function () { |
454 | + var oobj = $(this).find("input[type='file']"); | ||
455 | + var files = oobj[0].files; | ||
456 | + | ||
457 | + for(var i=0; i<files.length;i++){ | ||
458 | + var obj = files[i]; | ||
459 | + if(obj!=null && obj!=''){ | ||
460 | + if(obj.type.toLowerCase() == 'image/png'){ | ||
461 | + $.messager.alert("提示","不允许上传png格式的图片", "info", function(){return false;}); | ||
462 | + return false; | ||
463 | + } | ||
464 | + } | ||
465 | + } | ||
466 | + | ||
430 | $.messager.progress({ | 467 | $.messager.progress({ |
431 | title: "正在执行", | 468 | title: "正在执行", |
432 | msg: "正在执行,请稍后...", | 469 | msg: "正在执行,请稍后...", |
-
Please register or login to post a comment