asp计算体重除于身高的平方

来源:百度知道 编辑:UC知道 时间:2024/05/13 14:57:52
第一行:文本域1 文本域2 确定按钮
第二行:你的测试结果: 文本域1 文本域2
第三行:你的指数:

当在文本域1,文本域2分别输入二个数字后单击确定按钮(第二行,第三行都不显示)
在第二行会显示你刚输入的文本域1与文本域2(第一行不显示第三行显示)
最后会显示出你的指数(第一行不显示第二行显示)

小弟做个网页但ASP不太行 只能模仿
有请哪位高手教教,万分感谢

新建一个tizhong.asp(必须是这个名字,如果要改,注意连代码里面的tizhong.asp一起改了,只有一处,在表单的action里),然后把下面代码复制上就可以啦~
<html>
<head>
<title>体重指数计算</title>
<% shengao=clng(Request("shengao"))
tizhong=clng(Request("tizhong"))
%>
</head>
<body>
<form name="form1" method="post" action="tizhong.asp">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<% if shengao=0 or tizhong=0 then %>
<tr>
<td align="center">体重(Kg):
<input name="tizhong" type="text" id="tizhong" size="3" maxlength="3">
身高(cm): <input name="shengao" type="text" id="shengao" size="3" maxlength="3"></td>
</tr>
<% else%><