如何这种显示方法?为什么没有显示,菜啊!

playboylee 2004-01-05 10:01:08
不提交是不是不行啊!?可是我想这种显示,应该如何啊?

<td width="25%">
<select name="test">
<option value="1000" selected>普通会员</option>
<option value="2000">VIP会员</option>
<option value="3000">高级会员</option>
</select>
</td>
<td width="64%"><?php
if($test=="1000")
{
echo $test;
}
else if($test=="2000")
{
echo $test;
}
else
{
echo $test;
}
?>
...全文
43 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
mikespook 2004-01-05
  • 打赏
  • 举报
回复
JS就能完成,不用PHP的`~~~~

给你看段代码,是我做一个图库收集程序时用的~~~~应该对你有启发~~~

<script language="JavaScript" type="text/JavaScript">
function ChangeType()
{
if(this.document.form.filetype.value==0)
{
this.document.all.neturl1.style.display="";
this.document.all.upfile1.style.display="none";
this.document.all.neturl2.style.display="";
this.document.all.upfile2.style.display="none";
}
else
{
this.document.all.neturl1.style.display="none";
this.document.all.upfile1.style.display="";
this.document.all.neturl2.style.display="none";
this.document.all.upfile2.style.display="";
}
}
function InitPage()
{
this.document.all.neturl1.style.display="";
this.document.all.upfile1.style.display="none";
this.document.all.neturl2.style.display="";
this.document.all.upfile2.style.display="none";
}
</script>
<tr>
<td width="11%">上传方式:</td>
<td width="89%"><select name="filetype" id="filetype" class="TableLine" onChange="ChangeType();">
<option value="0" selected>网络地址</option>
<option value="1">上传文件</option>
</select> </td>
</tr>
<tr>
<td width="11%"><div id="neturl1">网络地址:</div><div id="upfile1">上传图片:</div></td>
<td width="89%"><div id="neturl2"><input name="neturl" type="text" class="TextBox" id="neturl"></div><div id="upfile2"><input type="file" name="upfile" class="TextBox"></div></td>
</tr>
feyge 2004-01-05
  • 打赏
  • 举报
回复
其实那个onchange其实也是一个提交
itian 2004-01-05
  • 打赏
  • 举报
回复
大概是一个JS。根据option的onchange事件改变value。

不太记得了。去找一下吧。
mahaixing 2004-01-05
  • 打赏
  • 举报
回复
不提交是不行的,不提交怎么触发程序运行呢?
playboylee 2004-01-05
  • 打赏
  • 举报
回复
谁可以帮下我啊!不提交就可以显示啊!如何做啊!要用什么方法呢?
playboylee 2004-01-05
  • 打赏
  • 举报
回复
有别的方法吗?
feyge 2004-01-05
  • 打赏
  • 举报
回复
是要提交
xingxingailulu 2004-01-05
  • 打赏
  • 举报
回复

我认为只有触发事件才能有‘动态’的效果。
xingxingailulu 2004-01-05
  • 打赏
  • 举报
回复

谢谢‘大懒猫’我学到一些我不会的知识。

十分感谢~!

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧