<inputtype="text"maxlength="5"/>可以限制最大输入长度。如果type是number:<inputtype="number"maxlength="5"/>maxlength失效,长度可以无限输入。可以使用JS来解决这个问题:<inputtype="number"oninput="if(value.length>5)value=value.slice(0,5)"/>
分类:
其他好文 时间:
2017-04-17 15:02:19
阅读次数:
118
<formenctype="multipart/form-data"action="URL"method="post">
<inputtype="file"name="brand_logo"/>
</form>在上传图片test1.png后,打印$_FILES数组,打印结果如下array(size=1)
‘brand_logo‘=>
array(size=5)
‘name‘=>string‘test1.png‘(length=..
分类:
Web程序 时间:
2017-04-14 15:02:10
阅读次数:
152
简单的HTTP POST 大家通过HTTP向服务器发送POST请求提交数据,都是通过form表单提交的,代码如下: <form method="post"action="http://w.sohu.com" > <inputtype="text" name="txt1"> <inputtype="t ...
分类:
Web程序 时间:
2017-04-09 14:38:09
阅读次数:
284
在做批量购买时,我们需要点选需要的商品,然后点批量购买。每一次点选,下面立即计算出合计的数量和金额。主要代码如下:<td><inputtype="checkbox"name="oid[]"id="oid{$vo.id}"value="{$vo.id}"></td>:::合计购入:(积分)需要(兑股积分)我的兑股积分..
分类:
其他好文 时间:
2017-03-29 19:34:31
阅读次数:
128
<formid="formData"method="post"action="${pageContext.request.contextPath}/save"><inputtype="button"value="确认提交"class="tj-btn"id="tj"></form><scripttype="text/javascript">$(‘#tj‘).click(function(){checkSubmit();$.ajax({type:‘POST‘..
分类:
Web程序 时间:
2017-02-23 16:26:48
阅读次数:
180
<!DOCTYPEhtml><htmlng-app><head> <metacharset="utf-8"> <metahttp-equiv="X-UA-Compatible"content="IE=edge"> <title></title></head><body> Yourname:<inputtype="text"ng-model="yourname"placeholder="World"..
分类:
其他好文 时间:
2017-02-07 17:14:21
阅读次数:
163
<!DOCTYPEhtml><html><head> <metacharset="utf-8"> <metahttp-equiv="X-UA-Compatible"content="IE=edge"> <title></title></head><body> <divid="app"> <p>{{message}}</p> <inputtype="text"..
分类:
Web程序 时间:
2017-02-07 17:14:21
阅读次数:
301
<!DOCTYPEhtml><html><head> <metacharset="utf-8"> <metahttp-equiv="X-UA-Compatible"content="IE=edge"> <title></title></head><body> <divid="app"><p><inputtype="text"v-model="message"><..
分类:
Web程序 时间:
2017-02-07 17:12:18
阅读次数:
219
<scripttype="text/javascript"> functionhuoqu(){ varG=document.getElementById(‘value‘).value; alert(G); }</script><body> <divclass="containter"> <divclass="row"> <divclass="md-col-12"> <inputtype="text"id="value"..
分类:
Web程序 时间:
2017-02-04 17:12:44
阅读次数:
294
出现这种错误第一时间是怀疑CSRF没有填写的原因,不建议网上所说的关闭csrf,这存在安全隐患,于是直接在表单填写<inputtype="hidden"name="_csrf"id=‘csrf‘value="<?=Yii::$app->request->csrfToken?>">重新提交以下,还是同样的问题,于是追踪源码,发现nam..
分类:
其他好文 时间:
2017-02-02 00:01:38
阅读次数:
468