2 回答
TA贡献1816条经验 获得超4个赞
使用 javascript 解决这类问题很容易处理
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<input type="text" name="val2" id='val2' oninput="loadVal3(this.value)">
<input type="text" name="val3" id='val3'>
<script type="text/javascript">
function loadVal3(val) {
let val1=10;
if(!isNaN(val)&&val!=""){
document.getElementById('val3').value=val1-val;
}else{
document.getElementById('val3').value="";
}
}
</script>
</body>
</html>
TA贡献2036条经验 获得超8个赞
// i use the REQUEST HTTP Request variables (is can changed by GET Or Post request
$secoundVarible = $_REQUEST['value'];
$staticValue = 10;
function reduceValue($num1,$num2){
return $result = $num1 - $num2;
}
$reducedValue = reduceValue($staticValue, $secoundVarible);
echo "<input type='text' value='$reducedValue'></input>";
- 2 回答
- 0 关注
- 92 浏览
添加回答
举报