This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 想依据SELECT的不同选项,决定是否显示接下来的TEXT INPUT对象,哪位大侠知道如何做?
-walacato(ERIC);
2006-1-30
(#2753038@0)
-
use JavaScript
-xanada(㊣流水);
2006-1-30
(#2753048@0)
-
Thanks, but I want to known "how to" code it using Javascript
-walacato(ERIC);
2006-1-30
(#2753175@0)
-
sample code inside<form name="myform">
<SELECT NAME="myselect">
<OPTION VALUE="valueA" selected>ABCD
<OPTION VALUE="valueB">EFGH
</SELECT>
</form>
inside javascript function:
var value = document.myform.myselect.value;
if(value == "valueA"){...}
else {...}
-exception(违例);
2006-1-30
{267}
(#2753354@0)
-
hehe, so simple a question, this is the real sample, u have to use style.visibility to hide or show the TextBox
-binghongcha76(一只大猫);
2006-1-30
{717}
(#2753371@0)
-
Copy the all codes to a HTML file, use IE to run it, if u select "X4" , TextBox will be hidden, otherwise TextBox will be showen, good luck
-binghongcha76(一只大猫);
2006-1-30
(#2753383@0)
-
Just a little tip, this forum supports html code :)
-taop(Bard-Tamer);
2006-1-30
{625}
(#2753411@0)
-
oh well, maybe not for the JS codes. sry :p
-taop(Bard-Tamer);
2006-1-30
(#2753413@0)
-
是吗?我试试
-binghongcha76(一只大猫);
2006-1-30
{625}
(#2753494@0)
-
一个问题,这个SAMPLE可以隐藏INPUT,但是如何隐藏INPUT前面的文本提示呢?
-walacato(ERIC);
2006-1-31
(#2754538@0)
-
多谢上面两位大虾,It works. binghongcha76的SAMPLE可直接使用。<html>
<body>
<form name="myform">
<SELECT NAME="myselect" onchange="javascript:change();">
<OPTION VALUE="valueA" selected>ABCD
<OPTION VALUE="valueB">EFGH
</SELECT>
</form>
<script language="javascript">
function change()
{
var value = document.myform.myselect.value;
if(value == "valueA"){alert("test");}
else {alert("test1");}
}
change();
</script>
</body>
</html>
-walacato(ERIC);
2006-1-31
{408}
(#2754456@0)