<p> ~第一步~ ~第二步~ ~第三步~ </p>点击下一步 时。到第二步。…………<div id="div_fields_0">
<h1>第一步</h1>
<form method="post" action="a.php?uid=1">
<input type="text" name="" value="第一步">
<input type="button" value="下一步">
</form>
</div><div id="div_fields_1">
<h1>第二步</h1>
<form method="post" action="b.php?uid=1">
<input type="text" name="" value="第二步">
<input type="button" value="下一步">
</form>
</div><div id="div_fields_2">
<h1>第3步</h1>
<form method="post" action="c.php?uid=1">
<input type="text" name="" value="第三步">
<input type="button" value="完成">
</form>
</div>
<h1>第一步</h1>
<form method="post" action="a.php?uid=1">
<input type="text" name="" value="第一步">
<input type="button" value="下一步">
</form>
</div><div id="div_fields_1">
<h1>第二步</h1>
<form method="post" action="b.php?uid=1">
<input type="text" name="" value="第二步">
<input type="button" value="下一步">
</form>
</div><div id="div_fields_2">
<h1>第3步</h1>
<form method="post" action="c.php?uid=1">
<input type="text" name="" value="第三步">
<input type="button" value="完成">
</form>
</div>
把
<div id="div_fields_0">
<h1>第一步</h1>
<form method="post" action="a.php?uid=1">
<input type="text" name="" value="第一步">
<input type="button" value="下一步">
</form>
</div>放到iframe里执行,这个就是最好的"JS"效果。
<h1>第一步</h1>
<form method="post" action="a.php?uid=1">
<input type="text" name="" value="第一步">
<input type="submit" value="下一步" >
</form>
</div>#a.php<div id="div_fields_0">
<h1>第二步</h1>
<form method="post" action="b.php?uid=1">
<input type="text" name="" value="第二步">
<input type="submit" value="下一步" >
</form>
</div>#b.php<div id="div_fields_0">
<h1>第三步</h1>
<form method="post" action="c.php?uid=1">
<input type="text" name="" value="第三步">
<input type="submit" value="下一步" >
</form>
</div>
<body>
<script>
//ID是要显示的DIV的ID
function show(id)
{
var temp = document.getElementById(id);
var divlist = document.getElementsByTagName("div");
if(temp)
{
for(i=0;i<divlist.length;i++)
{
divlist[i].style.visibility= "hidden";
}
temp.style.visibility = "visible"
}
}
</script>
<div id="div_fields_0" style="visibility:visible">
<h1>第一步</h1>
<form method="post" action="a.php?uid=1">
<input type="text" name="" value="第一步">
<input type="button" value="下一步" onclick="show('div_fields_1')">
</form>
</div><div id="div_fields_1" style="visibility:hidden">
<h1>第二步</h1>
<form method="post" action="b.php?uid=1" >
<input type="text" name="" value="第二步">
<input type="button" value="下一步" onclick="show('div_fields_2')">
</form>
</div><div id="div_fields_2" style="visibility:hidden">
<h1>第3步</h1>
<form method="post" action="c.php?uid=1">
<input type="text" name="" value="第三步" >
<input type="button" value="完成" onclick="show('div_fields_0')">
</form>
</div></body>
[code]