我已经对此有所了解,但我似乎无法找到关于不同浏览器如何处理事物的任何信息.
这是我在firefox中找到的fireBug.
在其他浏览器中是否相同?
如果是这样,原因是什么?
有没有办法(使用属性标志或类似的东西)启用禁用提交数据的表单字段?
或者,如果那是不可能的,有没有办法阻止字段使用css或任何其他属性进行编辑而不是隐藏它们?
我的特殊情况是一个数据集的标识符,应该以表格形式显示(不可编辑) - 如果没有更好的解决方案,我想我会使用一个隐藏字段,除了被禁用的字段以保持实际显示它的已禁用值.
我想禁用输入字段,但是当我提交表单时,它仍然应该传递值.
使用案例:我试图从谷歌地图获取经度和经度并想要显示它,但我不希望用户编辑它.
这可能吗?
我安装了Laravel 5.7
在文件中添加了一个表单 \resources\views\welcome.blade.php
<form method="POST" action="/foo" >
@csrf
<input type="text" name="name"/><br/>
<input type="submit" value="Add"/>
</form>
Run Code Online (Sandbox Code Playgroud)
添加到文件 \routes\web.php
Route::post('/foo', function () {
echo 1;
return;
});
Run Code Online (Sandbox Code Playgroud)
发送POST请求后:
419抱歉,您的会话已过期.请刷新并重试.
在版本5.6中没有这样的问题.
I am new at coding with bootstrap and jquery. how can i disable bootstrap switch in "onswitchchange" method option
Here my javascript/jquery code:
$("input[type=checkbox]").bootstrapSwitch({
size:"mini",
onSwitchChange:function(event, state) {
this.disabled = true; //checkbox change into disabled
}
});
Run Code Online (Sandbox Code Playgroud)
i also tried to change this.disabled = true into $(this).setDisabled(true); and it returning error of course. i just want to know how to call setDisable method inside onswitchchange method. if it cannot be like that. is there any other way to disable the …
在我的应用程序中,在加入的帮助下,我在我的jsp页面中显示动态值,如下所示:
<% while(rs.next()){ %>
<td><input type="checkbox" name="chkName" onclick="selectall()"></td>
<td><input type="text" name="empId" value="<%= rs.getString(1)%> " disabled="disabled" maxlength="10"></td>
<td><input type="text" name="device" value="<%= rs.getString(2)%>" disabled="disabled" maxlength="10"></td>
<td><input type="text" name="features" value="<%= rs.getString(3)%>" disabled="disabled" maxlength="60"></td>
<td><input type="password" name="password" disabled="disabled"></td>
<td><input type="text" name="policyName" value="<%= rs.getString(4)%>" disabled="disabled" maxlength="10"></td>
</tr>
<% }
%>
Run Code Online (Sandbox Code Playgroud)
每当从另一个servlet(因为我想显示从这个jsp到另一个jsp的提取)我正在调用时request.getParameter("empId"),它正在获取"NULL"值.我想,我必须使用set(session.setAttribute()或request.setParameter()).
任何建议将不胜感激.
那是我的测试代码:
<?php
if(isset($_POST['Submit']))
{
if(isset($_POST['Est1'])) echo 'Est1 : ' . $_POST['Est1'] . '<br>';
if(isset($_POST['Est2'])) echo 'Est2 : ' . $_POST['Est2'] . '<br>';
if(isset($_POST['Est3'])) echo 'Est3 : ' . $_POST['Est3'] . '<br>';
if(isset($_POST['Est4'])) echo 'Est4 : ' . $_POST['Est4'] . '<br>';
}
?>
<form method="post">
<input type="text" name="Est1" id="Val1" value=""/>
<input type="text" name="Est2" id="Val2" value=""/>
<input type="text" name="Est3" id="Val3" value=""/>
<input type="text" name="Est4" id="Val4" value="test" disabled="disabled"/>
<input type="submit" name="Submit" value="Submit" />
</form>
Run Code Online (Sandbox Code Playgroud)
在这种形式中,当我发送输入的值时,Est4永远不会返回:isset($ _ POST ['Est4'])返回false!
为什么?