首页 新闻 会员 周边

html的input不能输入,是什么问题啊?

0
[待解决问题]

求助大佬!!这是html代码,第一个input可以正常输入,第二个就不可以,然后这个提交的按钮也不能使用

<div style="background-color: #DDDDDD;
text-align:justify;
text-justify:inter-ideograph;
width: 500px;
height: 200px;
position:absolute;
margin-left: 300px;
margin-top: -50px;
border-radius: 20px;padding-left: 10px;padding-top: 10px;">
<p style="font-size: 20px;
color: #000c17;
text-align:justify;
text-justify:inter-ideograph;">请输入要trunk的接口:</p>
<input style="
color: #000c17;
font-size: 20px;margin-top: 10px;border-radius: 20px;padding-left: 10px;" type="text" placeholder="interface-ID" name="interID"><br>
<p style="font-size: 20px;
color: #000c17;
text-align:justify;
text-justify:inter-ideograph;margin-top: 10px;">请输入接口允许通过的vlan:</p>
<input style="color: #000c17;position: absolute;
font-size: 20px;margin-top: 10px;border-radius: 20px;padding-left: 10px;" type="text" placeholder="vlan-ID" name="vlanID"><br>
<button type="submit" style="display: block;
background: #008f00;
color: #FFF;
position: absolute;
font-weight: bold;
font-size: 19px;
line-height: 40px;
margin-left: 450px;margin-top: -20px;
border-radius: 32px;
width: 20%;
border-color: #00A000;
{#onclick="javascript:document.querySelector('#winmsg'.remove())"#}
">提交</button>

问题补充:

这个是在django框架里面写的

Linux^O^的主页 Linux^O^ | 菜鸟二级 | 园豆:208
提问于:2023-04-13 11:10
< >
分享
所有回答(3)
0

input输入没问题,按钮的话submit常用于提交form表单,然后你这按钮还有一个onclick事件,竟然写在了css样式里面,而且这个click事件写的都有语法错误,不符合js语法。最后再吐槽下这个style样式,不建议写行内样式,看起来很不舒服。猜你是想写个表单,点击提交获取到表单里面输入的值。要不再去补补基础吧或者找个现成django的项目参考一下

李珍拆 | 园豆:188 (初学一级) | 2023-04-13 12:45
0

根据您提供的HTML代码,第二个输入框无法输入的原因可能是因为它的样式设置了“position: absolute”,导致它覆盖在第一个输入框的上方。您可以尝试将第二个输入框的样式更改为相对定位(position: relative)或静态定位(position: static),以便它们可以堆叠在一起。

而关于提交按钮不能使用的问题,您没有提供相关的代码或错误信息,因此无法确定具体的原因。建议您检查您的JavaScript代码是否正确,并查看控制台输出是否有任何错误信息。您也可以提供更多的代码或错误信息,以便我们更好地帮助您解决问题。

台群精机 | 园豆:215 (菜鸟二级) | 2023-04-13 15:41
0

这个问题可能是由于输入框被禁用或只读,或者输入法被禁用导致的。您可以尝试使用以下方法解决问题:

禁止输入中文:input type=“text” style=“ime-mode:disabled”
禁止黏贴、禁止拖拽、禁止中文输入法:input type=“text” onpaste=“return false” ondragenter=“return false” oncontextmenu=“return false” onkeydown=“return event.keyCode!=67&&event.keyCode!=86&&event.keyCode!=65”>
禁用输入框:input type=“text” disabled
只读输入框:input type=“text” readonly

可乐加冰好喝 | 园豆:202 (菜鸟二级) | 2023-04-13 20:39
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册