Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在修改模式下自动填充下拉列表并显示其他选项_Html_Node.js_Ejs - Fatal编程技术网

Html 如何在修改模式下自动填充下拉列表并显示其他选项

Html 如何在修改模式下自动填充下拉列表并显示其他选项,html,node.js,ejs,Html,Node.js,Ejs,这是针对查看模式,我应该如何自动填充以前的值,以及在修改模式下为ejs中的选择框字段显示新值。ejs部分 <select class="form-control" style ="margin-left: 20px;width:340px" id="emp_id" name="emp_id" required placeholder="Enter the Employee Id"/> <

这是针对查看模式,我应该如何自动填充以前的值,以及在修改模式下为ejs中的选择框字段显示新值。

ejs部分

 <select class="form-control" style ="margin-left: 20px;width:340px" id="emp_id" name="emp_id" required placeholder="Enter the Employee Id"/>

                                            <option value="">Employee Name</option>
                                            <% for (i = 0; i < emp_id_count; i++)  {%>
                                            <option value="<%= employee[i].emp_id %>"> <%=empname[i].emp_name %></option>
                                            <% }; %>
                            </select>
然后呈现页面

<form name="mod" id="mod" action="/employeeModule/employeeDetails/modempdet" method="post">
                            <label for="empid" style="color:#404040;margin-left: 50px">Employee Name <span style="color:red;font-size: 10pt">*</span></label>
                            <select class="form-control" style ="margin-left: 50px;width:340px" id="emp_id" name="emp_id" placeholder="Enter the Employee Id"/>


                                            <option value="">Employee Name</option>
                                            <% for (i = 0; i < emp_id_count; i++)  {%>
                                            <option value="<%= employee[i].emp_id %>"> <%=empname[i].emp_name %></option>
                                            <% }; %>

                            </select>
            //query to fetch other Data from Table for employee Access

            pdbconnect.query("SELECT comm_code_id,comm_code_desc from common_code_tbl where code_id = 'ACC' ",function(err,result){
            comm_code_empAccess=result.rows;
            comm_code_empAccess_count=result.rowCount;

            //query to select description of designation

            pdbconnect.query("select comm_code_desc from common_code_tbl where comm_code_id=$1",[desig],function(err,resultset){
            desig_desc=resultset.rows['0'].comm_code_desc;

            //query to fetch other Data from Table for designation

            pdbconnect.query("SELECT comm_code_id,comm_code_desc from common_code_tbl where code_id = 'DSG' ",function(err,result){
            comm_code_desig=result.rows;
            comm_code_desig_count=result.rowCount;