重庆网站编辑职业学校,广告艺术设计学的是什么,网站建设预算模板,pc端网页设计模板JSP中 input type 用法 Input表示Form表单中的一种输入对象#xff0c;其又随Type类型的不同而分文本输入框#xff0c;密码输入框#xff0c;单选/复选框#xff0c;提交/重置按钮等#xff0c;下面一一介绍。 1#xff0c;typetext 输入类型是text#xff0c;这是我们…JSP中 input type 用法 Input表示Form表单中的一种输入对象其又随Type类型的不同而分文本输入框密码输入框单选/复选框提交/重置按钮等下面一一介绍。 1typetext 输入类型是text这是我们见的最多也是使用最多的比如登陆输入用户名注册输入电话号码电子邮件家庭住址等等。当然这也是Input的默认类型。 参数name同样是表示的该文本输入框名称。 参数size输入框的长度大小。 参数maxlength输入框中允许输入字符的最大数。 参数value输入框中的默认值 特殊参数readonly表示该框中只能显示不能添加修改。 form your name: input typetext nameyourname size30 maxlength20 value输入框的长度为30允许最大字符数为20br input typetext nameyourname size30 maxlength20 readonly value你只能读不能修改 /form 2typepassword 不用我说一看就明白的密码输入框最大的区别就是当在此输入框输入信息时显示为保密字符。 参数和“typetext”相类似。 form your password: input typepassword nameyourpwd size20 maxlength15 value123456密码长度小于15 /form 3typefile 当你在BBS上传图片在EMAIL中上传附件时一定少不了的东西 提供了一个文件目录输入的平台参数有namesize。 form your file: input typefile nameyourfile size30 /form 4typehidden 非常值得注意的一个通常称为隐藏域如果一个非常重要的信息需要被提交到下一页但又不能或者无法明示的时候。 一句话你在页面中是看不到hidden在哪里。最有用的是hidden的值。 form nameform1 your hidden info here: input typehidden nameyourhiddeninfo valuecnbruce.com /form script alert(隐藏域的值是 document.form1.yourhiddeninfo.value) /script 5typebutton 标准的一windows风格的按钮当然要让按钮跳转到某个页面上还需要加入写JavaScript代码 form nameform1 your button: input typebutton nameyourhiddeninfo valueGoGoGo οnclickwindow.open(http://www.cnbruce.com) /form 6typecheckbox 多选框常见于注册时选择爱好、性格、等信息。参数有name,value及特别参数checked表示默认选择 其实最重要的还是value值提交到处理页的也就是value。附name值可以不一样但不推荐。 form nameform1 a:input typecheckbox namecheckit valuea checkedbr b:input typecheckbox namecheckit valuebbr c:input typecheckbox namecheckit valuecbr /form name值可以不一样但不推荐br form nameform1 a:input typecheckbox namecheckit1 valuea checkedbr b:input typecheckbox namecheckit2 valuebbr c:input typecheckbox namecheckit3 valuecbr /form 7typeradio 即单选框出现在多选一的页面设定中。参数同样有name,value及特别参数checked. 不同于checkbox的是name值一定要相同否则就不能多选一。当然提交到处理页的也还是value值。 form nameform1 a:input typeradio namecheckit valuea checkedbr b:input typeradio namecheckit valuebbr c:input typeradio namecheckit valuecbr /form 下面是name值不同的一个例子就不能实现多选一的效果了br form nameform1 a:input typeradio namecheckit1 valuea checkedbr b:input typeradio namecheckit2 valuebbr c:input typeradio namecheckit3 valuecbr /form 8typeimage 比较另类的一个自己看看效果吧可以作为提交式图片 form nameform1 actionxxx.asp your Imgsubmit: input typeimage src../blog/images/face4.gif /form 9typesubmit and typereset 分别是“提交”和“重置”两按钮 submit主要功能是将Form中所有内容进行提交action页处理reset则起个快速清空所有填写内容的功能。 form nameform1 actionxxx.asp input typetext nameyourname input typesubmit value提交 input typereset value重置 /form 转载于:https://www.cnblogs.com/eva_2010/articles/input.html