parent.document.formName.txtName.value=document.formName.select.options[document.formName.select.selectedIndex]text

解决方案 »

  1.   

    不是狠明白啊.
    我重新写一下吧post.php:
    <form name="form1" method="post" action="post.php" onsubmit="return validate(this)" > <input name="hidecnname" type="hidden" id="hidecnname">
    <iframe src="select.php" name="selectdb" width="300" marginwidth="0" height="24" marginheight="0" scrolling="no" frameborder="0"></iframe></form>select.php:
    <form name="formdbsql" method="post" action="select.php">
      <input type="text" name="cnname" onclick="parname()"></form>如何将手工写入select.php的cnname的数据,动态传到post.php中的hidecnname中?谢谢.
      

  2.   

    post.php<form name="form1" method="post" action="post.php" onsubmit="return validate(this)" > <input name="hidecnname" type="text" id="hidecnname">
    <iframe src="select.php" name="selectdb" width="300" marginwidth="0" height="24" marginheight="0" scrolling="no" frameborder="0"></iframe></form>
    select.php<form name="formdbsql" method="post" action="select.php">
      <input type="text" name="cnname" onclick="parname(this.value)" value="text"></form>
    <script>
    function parname(str)
    {
        top.document.all.hidecnname.value = str;   //用top指向顶级窗口.
    }
    </script>
      

  3.   

    能不能不用onclick?
    就是说我在input1上面一边打字,input2上面就能显示出我打的字?