如何用表单组件实现浏览器中的“回退”功能?????????

如果a页是一个表单,提交时因某种原因转至出错页面b,如何在b中返回已填写数据的表单a(数据不变)?
---------------------------------------------------------------

表单a,要保留的都使用class=saveHistory

 1<html>
 2<head>
 3<meta content="history" name="save"/>
 4<style>   
 5.saveHistory {behavior:url(#default#savehistory);}   
 6</style>
 7</head>
 8<body>
 9<form name="a">
10<input class="saveHistory" id="oPersistInput" type="text"/>
11</form>
12</body>
13</html>

---------------------------------------------------------------

上面的代码确保表单a(数据不变),后退功能在出错页面b可以使用history.back()或history.go(-1)都可以实现,例如:

1<input onclick="history.back()" type="button" value="Back"/>
1<input onclick="history.go(-1)" type="button" value="Back"/>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus