提交禁用的输入字段的值 [英] Submitting the value of a disabled input field

查看:113
本文介绍了提交禁用的输入字段的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用一个输入字段,但是当我提交表单时,它仍然应该传递值。



用例:我试图获取经度和纬度来自Google地图并希望显示它,但我不希望用户编辑它。



这可能吗?

表单中禁用一个输入字段,当我从提交表单
时, >禁用表单不是
提交



使用案例:我正在尝试从Google地图获取Lat Lng
并要显示它..
,但不想让用户编辑它。


您可以使用 readonly 您的输入字段中的属性

 < input type =text readonly =只读/> 


I want to disable an input field, but when I submit the form it should still pass the value.

Use case: I am trying to get latitude and longitude from Google Maps and wanna display it, but I don't want the user to edit it.

Is this possible?

解决方案

I wanna Disable an Input Field on a form and when i submit the form the values from the disabled form is not submitted.

Use Case: i am trying to get Lat Lng from Google Map and wanna Display it.. but dont want the user to edit it.

You can use the readonly property in your input field

<input type="text" readonly="readonly" />

这篇关于提交禁用的输入字段的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆