From 30ba6c6ec8d227636ef4dafe7b5de877b2a0722b Mon Sep 17 00:00:00 2001
From: zm <zm@iemsoft.cn>
Date: Fri, 25 Sep 2020 18:49:48 +0800
Subject: [PATCH] 知识点未完

---
 we254/addons/fy_teacher/template/mobile/index/edit.html |   43 +++++++++++++++++++------------------------
 1 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/we254/addons/fy_teacher/template/mobile/index/edit.html b/we254/addons/fy_teacher/template/mobile/index/edit.html
index 552c7b3..15805c3 100644
--- a/we254/addons/fy_teacher/template/mobile/index/edit.html
+++ b/we254/addons/fy_teacher/template/mobile/index/edit.html
@@ -585,9 +585,9 @@
         //$("#knowdiv").empty();
         spec_html += '<div id="add_know_parent" class="input-group w60">';
         spec_html += '	<span class="input-group-addon">专题名称</span>';
-        spec_html += '	<input type="text" class="input" id="know_parent_name" name="know_parent_name">';
+        spec_html += '	<input type="text" class="input" name="know_parent_name[]">';
         spec_html += '	<span class="input-group-addon">知识点名称</span>';
-        spec_html += '	<input type="text" class="input" id="know_name" name="know_name">';
+        spec_html += '	<input type="text" class="input" name="know_name[]">';
         spec_html += '</div>';
 
         $("#knowdiv").append(spec_html);
@@ -795,31 +795,26 @@
 		return false;
 	}
     <?php if($type=='5'){ ?>
-        if($("#know_parent option:selected").val()=='0' || $("#know_parent option:selected").val()==''){
-            alert('请选择专题');
-            $("#know_parent").focus();
-            return false;
-	    }
-        if($("#know_parent option:selected").val()!='-1' &&($("#know_child option:selected").val()=='0' || $("#know_child option:selected").val()=='')){
+        if($("#selectposhidden").val()=='' || $("#selectposhidden").val()==','){
             alert('请选择知识点');
-            $("#know_child").focus();
             return false;
 	    }
-        if($("#know_parent option:selected").val()=='-1' && $("#know_parent_name").val()==''){
-            alert('请输入要添加专题的名称');
-            $("#know_parent_name").focus();
-            return false;
-	    }
-        if($("#know_parent option:selected").val()=='-1' && $("#know_name").val()==''){
-            alert('请输入要添加知识点的名称');
-            $("#know_name").focus();
-            return false;
-	    }
-        if($("#know_child option:selected").val()=='-1' && $("#know_name").val()==''){
-            alert('请输入要添加知识点的名称');
-            $("#know_name").focus();
-            return false;
-	    }
+        var know_name_arr = $("input[name='know_name[]']");
+        var know_parent_name_arr = $("input[name='know_parent_name[]']");
+
+        for(var i in know_name_arr){
+            if(know_name_arr[i].value.trim() != '' && know_parent_name_arr[i].value.trim() == ''){
+                alert("请输入专题名称");
+                know_parent_name_arr[i].focus();
+                return false;
+            }
+            if(know_parent_name_arr[i].value.trim() != '' && know_name_arr[i].value.trim() == ''){
+                alert("请输入知识点名称");
+                know_name_arr[i].focus();
+                return false;
+            }
+        }
+        
 	<?php } ?>
 
 	if($("input[name=images]").val()==''){

--
Gitblit v1.8.0