要求隐藏字段

编程入门 行业动态 更新时间:2024-10-28 08:22:55
本文介绍了要求隐藏字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我的代码:

<label for="uploadFile" class="custom-uploadFile"> <i class="fa fa-cloud-upload"></i> UPLOAD ID </label> <input class="form-control input-lg" name="picture" id="uploadFile" type="file" style="display:none;" required>

我想让此上传字段为必填字段,但输入为隐藏. 我必须使用一些javascript或解决该问题的方法,因为我看了很多tuto,但没有用! 谢谢

I WANT the let this field of upload required but the input is hidden . i must use some javascript or what to solve this problem because i watched a lot of tuto but not work ! Thank you

推荐答案

如果要查看表单验证消息,可以使用不透明度隐藏输入.

If you want to see the form validation message you can hide the input using opacity.

#uploadFile { opacity: 0; width: 0; float: left; /* Reposition so the validation message shows over the label */ } div { text-align: center; }

<form> <input name="picture" id="uploadFile" type="file" required> <label for="uploadFile">Upload label</label> <div><input name="submit" type="submit"></div> </form>

更多推荐

要求隐藏字段

本文发布于:2023-06-05 01:14:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/508838.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!