jquery - Can I write form tags in other form tags? -
jquery - Can I write form tags in other form tags? -
can write form tag in other form tag? requirement implement file upload. here using underscore js template , maintain items 1 form. after adding upload code within form not able finish file upload functionality. please have code below code.
<script type="text/template"><div class="container"></br></br> <% _.each(forms, function(form){ %> <form id="<%= formid(form) %>" name="<%= formcaption(form) %>"> <%_.each(form.layout.grid, function(grid){ _.each(grid.columns, function(column){ var dclayoutinfo = datacontrollayoutinfo(column); var dcinfo = datacontrolinfo(form.datacontrols,dclayoutinfo.datacontrol); var datacontrols = formdatacontrols(form) _.each(datacontrols, function(datacontrol){ if(dcinfo.id == datacontrol.id){%> <div class="form-group"><div class="row datacontrol" id="<%=datacontrolid(datacontrol)%>"> <% _.each(datacontrol.layout.grid, function(grid){ _.each(grid.columns, function(column){ var datatypes = datacontroldatatypes(datacontrol); var datatypelayoutinfo = datatypelayoutinfo(column); var datatypeinfo = datatypeinfo(datatypes,datatypelayoutinfo.datatype); if("label" == datatypeinfo.datatype){ %> <div class="col-sm-2" ><label class="input-sm control-label lableid" id="<%= datatypeinfo.id %>" data-type="label"><%=datatypeinfo.caption%></label></div> <%}else if("text" == datatypeinfo.datatype){%> <!--div class="col-sm-8 p-r-0"><input id="<%= datatypeinfo.id %>" class="form-control input-sm selected datatype" type="<%= datatypeinfo.type %>" data-type="text"/></div--> <div class="col-sm-5"><input id="<%= datatypeinfo.id %>" type="<%= datatypeinfo.type %>" class="form-control input-sm selected datatype" data-type="text"></div> <%}else if("progress" == datatypeinfo.datatype){%> <!--div class="col-sm-10"><div class="progress slider"><div id="<%= datatypeinfo.id %>" class="progress-bar datatype" data-type="progress" role="progressbar" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="width:25%"/> </div></div>--> <div class="col-md-5 m-t-4"><div class="slider-container"><input id="<%= datatypeinfo.id %>" type="<%= datatypeinfo.type %>" class="input-slider datatype" data-slider-min="-20" data-slider-max="150" data-slider-value="0" data-type="progress"></div></div> <!--date command --> <%}else if("datepicker" == datatypeinfo.datatype && datatypeinfo.range==false){%> <div class="col-sm-1 m-b-15 m-r-5"><div class="input-icon datetime-pick date-only"><input placeholder="mm/dd/yyyy" type="<%= datatypeinfo.type %>" class="form-control input-sm datatype" id="<%= datatypeinfo.id %>" data-type="datepicker" range="<%= datatypeinfo.range %>"> <span class="add-on-right "><i class="fa fa-calendar"></i></span></div></div><div class="col-sm-1 m-b-15"> <div class="input-icon datetime-pick time-only"><input placeholder="hh:mm" type="<%= datatypeinfo.type %>" class="form-control input-sm datatype" data-format="hh:mm:ss" id="<%= datatypeinfo.id %>"> <span class="add-on-right "><i class="fa fa-clock-o"></i></span></div></div> <%}else if("datepicker" == datatypeinfo.datatype && datatypeinfo.range==true){%> <div class="col-sm-1 m-b-15 m-r-5"><div class="input-icon datetime-pick date-only"> <input placeholder="mm/dd/yyyy" type="<%= datatypeinfo.type %>" class="form-control input-sm datatype" id="<%= datatypeinfo.id %>" data-type="datepicker" range="<%= datatypeinfo.range %>"> <span class="add-on-right "><i class="fa fa-calendar"></i></span></div></div><div class="col-sm-1 m-b-15"> <div class="input-icon datetime-pick time-only"><input placeholder="hh:mm" type="<%= datatypeinfo.type %>" class="form-control input-sm" data-format="hh:mm:ss" id="<%= datatypeinfo.id %>"> <span class="add-on-right "><i class="fa fa-clock-o"></i></span></div></div> <div><span class="add-on-right pull-left"><i class="fa fa-minus p-t-10"></i></span></div><div class="col-sm-1 m-b-15 pull-left"> <div class="input-icon datetime-pick date-only"><input placeholder="mm/dd/yyyy" type="<%= datatypeinfo.type %>" class="form-control input-sm enddate" id="<%= datatypeinfo.id %>" data-type="datepicker"> <span class="add-on-right "><i class="fa fa-calendar" id="calendar"></i></span></div></div> <div class="col-sm-1 m-b-15"><div class="input-icon datetime-pick time-only"><input placeholder="hh:mm" type="<%= datatypeinfo.type %>" class="form-control input-sm " data-format="hh:mm:ss" id="<%= datatypeinfo.id %>"> <span class="add-on-right"><i class="fa fa-clock-o"></i></span></div></div> <!--category command --> <%}else if("category" == datatypeinfo.datatype){%> <div class="btn-group datatype" id="<%= datatypeinfo.id %>" data-type="category"> <% _.each(datatypeinfo.values, function(categoryobj){ %> <li class="onselectedcategory btn btn-gr-gray btn-sm m-r-20 ctg" data-id="<%= categoryobj.value %>"><%= categoryobj.value %></li> <% }); %> </div> <!--contact command --> <%}else if("contactpicker" == datatypeinfo.datatype){%> <div class="col-md-10"><div class="input-group"><span class="input-group-addon"><i class="fa fa-user"></i></span><input type="<%= datatypeinfo.type %>" class="form-control datatype" id="<%= datatypeinfo.id %>" name="<%= datatypeinfo.id %>" data-type="text"/><span class="input-group-addon"><i class="fa fa-book"></i></span></div></div> <!--category list command --> <%}else if("fieldset" == datatypeinfo.datatype){%> <div class="col-md-5"><div class="container datatype" data-type="fieldset" id="<%= datatypeinfo.id %>"> <select type="<%= datatypeinfo.type %>" class="form-control multiselect btn-group" id="categorylist" style="width: 400px;" multiple="multiple"> <% _.each(datatypeinfo.values, function(categoryobj){ %> <optgroup> <option value="<%= datatypeinfo.values %>"><%= categoryobj.value %></option> </optgroup> <% }); %> </select> </div> </div> <%}else if("file" == datatypeinfo.datatype){%> <div class="col-sm-9 fileupload fileupload-new input-icon selected datatype" id="<%= datatypeinfo.id %>" data-provides="fileupload" data-type="file"> <form id="upload" name="upload" action="api/v1/resources" method="post" type="<%= datatypeinfo.type %>" enctype="multipart/form-data"> <span class="btn btn-file btn-sm btn-alt"> <span class="fileupload-new p-l-15">add image...</span> <span class="fileupload-exists p-l-15">change</span> <input id="file" type="file" name="file"/><br> <input id="json" type="hidden" name="json"> <span class="add-on p-t-0"> <i class="icon"><b></b></i> </span> </span> <span class="fileupload-preview"></span> <a href="#" class="close close-pic fileupload-exists" data-dismiss="fileupload"> </a> <button type="submit" class="btn btn-sm submit" id="imageupload">upload</button> </form> <div id="message"></div> <div id="resource"></div> </div> <%}}); });%> </div></div> <%} }); }); }); });%> </br> <div class="row"> <div class="col-md-2"> </div> <div class="col-md-10"> <div align="center"> <button type="submit" class="btn btn-primary" id="itemsave"><i class="fa fa-check"/> submit</button> <button id="cancel" type="submit" class="btn btn-primary backtorecoddetails"><i class="fa fa-times"/> cancel</button> <div> </div> </div> <input id="hidden_appid" type="hidden" value= "<%=id%>" data-appname="<%=caption%>"> <input id="hidden_spaceid" type="hidden" value= "<%=spaceid%>"> </form>
no. can not nest forms. it's in the specification.
content model: flow content, no form element descendants.
jquery jquery-ui underscore.js
Comments
Post a Comment