注册局.手机:关于html代码的问题

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 02:07:55
在一个<form>下用另一个<form>,能吗?

比如
<form action="1.php" method="get" name="form1">
<form action="2.php" method="get" name="form2">
<input name="word" type="text" maxlength="50" value="">
<input type="submit" name="submit" value="进入">
</form>
</form>
-----
以上代码中word传给了1.php.如何让它传给2.php呢?

<form action="1.php" method="get" name="form1">
<input name="word" type="text" maxlength="50" value="">
<input type="submit" name="submit" value="进入">
</form>

<form action="2.php" method="get" name="form2">
<input name="word" type="text" maxlength="50" value="">
<input type="submit" name="submit" value="进入">
</form>

彼此值的交换可用javascript实现

对于前者可用document.form1.word.value 进行引用
对于后者可用document.form2.word.value 进行引用

===============
楼下的有问题吗?上面的代码有什么问题??

真不明白你在写些什么,这样的代码你没有测试一下吗?

不可以