注册 登录
编程论坛 ASP技术论坛

有两个问题请版主帮助解决谢谢!!

junzhe 发布于 2009-11-08 17:28, 498 次点击
第一个.在一个程序中,如果表单一是一个肯定选项比如有工人.经理等选项,当选择工人时,表单二自动生成工资为60元!当选择经理时,表单二自动生成工资为70元!
第二个.也是有两个表单,当输入应付工资时(人工输入的数),实际工资就自动出数!公式为(应付工资*3.65*0.85再除以2)的得数来!
6 回复
#2
junzhe2009-11-09 09:13
请帮忙谢谢!急!
#3
chenbofeng202009-11-09 09:53
第一个实现方法:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="">
  <label>
  <select name="select"  id="b" onChange="document.form1.a.value = b.value" >
    <option value="">请选择</option>
    <option value="60">工人</option>
    <option value="70">经理</option>
  </select>
  </label>
  <label>
  <input name="a" type="text" id="a">
  </label>
</form>
</body>
</html>
#4
chenbofeng202009-11-09 09:59
第二个实现方法:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="">
  <label>工资:
  <input type="text" name="b"  id="b"  onChange="document.form1.a.value = (b.value)*(3.65*0.85/2)">
  </label>
  <label>
  实际工资:
  <input name="a" type="text" id="a">
  </label>
</form>
</body>
</html>
#5
chenbofeng202009-11-09 10:00
第二个实现方法:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="">
  <label>工资:
  <input type="text" name="b"  id="b"  onChange="document.form1.a.value = (b.value)*(3.65*0.85/2)">
  </label>
  <label>
  实际工资:
  <input name="a" type="text" id="a">
  </label>
</form>
</body>
</html>
#6
gdk20062009-11-09 13:12
js可以搞定的事情,自己在网络上找找
#7
junzhe2009-11-11 08:14
如何用JS解决这两个问题呢?望帮忙
1