yii2 如何生成如下的HTML表单?
html
<form class="form-horizontal" role="form" method="post" id="formPost" name="formPost" onsubmit="ajaxPostInfo(this);return false;"> <div class="form-group"> <label for="inputEmail3" class="col-sm-1 control-label">标题</label> <div class="col-sm-10"> <input type="text" class="form-control" id="title" name="title" placeholder="标题5-16个字"> </div> </div> <div class="form-group"> <label for="content1" class="col-sm-1 control-label">内容</label> <div class="col-sm-10"> <textarea class="form-control" rows="3" name="content" id="content1"></textarea> </div> </div> <div class="form-group"> <label for="content" class="col-sm-1 control-label">省市区</label> <div class="col-sm-3"> <select class="form-control" name="d1" id="d1" onchange="selectNull('d2');selectNull('d3'); if(this.value) loadArea(this.value,'d2')"> <option value="">请选择</option> </select> </div> <div class="col-sm-3"> <select class="form-control" name="d2" id="d2" onchange="selectNull('d3'); if(this.value) loadArea(this.value,'d3')"> <option value="">请选择</option> </select> </div> <div class="col-sm-3"> <select class="form-control" name="d3" id="d3"> <option value="">请选择</option> </select> </div> </div> <div class="col-sm-offset-1 small"><p>您当前IP及归属地 <span id="ip-area" class="underline text-danger"></span>,请务必选择您该归属地所在省份,否则不予发布!</p> </div> <div class="only-unlogin hide"> <div class="form-group"> <label for="inputEmail3" class="col-sm-1 control-label">公司名</label> <div class="col-sm-10"> <input type="text" class="form-control" id="corpName" name="corpName" placeholder="请输入公司名称"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-1 control-label">联系信息</label> <div class="col-sm-3 form-inline"> <em>联系人</em> <input type="text" class="form-control" id="corpContact" name="corpContact" placeholder="请输入联系人姓名"> </div> <div class="col-sm-4 form-inline"> <em>联系电话</em> <input type="text" class="form-control" id="corpTel" name="corpTel" placeholder="请输入联系电话或手机"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-1 control-label">公司地址</label> <div class="col-sm-4"> <input type="text" class="form-control" id="corpAddress" name="corpAddress" placeholder="请输入公司地址"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-1 control-label">删除密码</label> <div class="col-sm-4"> <input type="text" class="form-control" id="delpw" name="delpw" placeholder="删除密码4-18位,不能有特殊字符、空格"> </div> </div> </div> <div class="form-group"> <div class="col-sm-offset-1 col-sm-10"> <button type="submit" class="btn btn-lg btn-primary"> 立即发布 </button> <button type="reset" class="btn btn-info">重设</button> </div> </div> </form>
害怕寂寞的魔王
9 years, 7 months ago