input只能输入大写字母

置顶 50
· 2024-03-05 21:43:35
<input type="text" maxlength="5" name="code" lay-verify="require" autocomplete="off" class="layui-input" style="text-transform:uppercase" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" >

此方法,限制输入框只能输入数字与字母,并且输入的字母自动转为大写,但后端接收的还是小写
采用转换的方式直接转成大写

$param['code'] = strtoupper($param['code']);