有三個網頁。我想將數據從我的第一頁和第二頁傳輸到第三頁。 第一個網頁是一個簡單的形式。 第二個網頁由動態表組成。 網頁應打印另外兩頁數據。保存表單輸入數據以在另一頁上使用
vib1.html
<h1><b>ENTER YOUR PERSONAL DETAILS</b></h1>
<form name="vibhu" action="file:///E:/eclipse_workspace/MyFirstWebApp/WebContent/html/vib3.html" method="GET">
<b>Full Name :</b><br><input type="text" name="name"><br>
<b>Age :</b><br><input type="text" name="age"><br>
<b>Gender :</b><br>
Male<input type="radio" name="gender">
Female<input type="radio" name="gender"><br>
<b>Email :</b><br><input type="text" name="email"><br><br>
<input type="submit" value="Next" >
</form>
</body>
</html>
vib2.html
<div>
<input type="button" value="Add" class="plusbtn" /> <input
type="button" value="Remove" class="minusbtn" />
</div>
<table width="50%" border="1" cellpadding="1" cellspacing="1"
class="test">
<tr>
<td>Street</td>
<td>HouseNo</td>
<td>City</td>
<td>Country</td>
</tr>
<tr>
<td><input type="text" class="txtbox" value="" /></td>
<td><input type="text" class="txtbox" value="" /></td>
<td><input type="text" class="txtbox" value="" /></td>
<td><input type="text" class="txtbox" value="" /></td>
</tr>
</table>
<form name="vibhu"
action="file:///E:/eclipse_workspace/MyFirstWebApp/WebContent/html/vib3.html"
method="GET">
<input type="submit" value="Submit">
</form>
<style>
.txtbox {
border: none;
width: 100%;
}
input {
font-size: 17px;
height: 30px;
}
table {
background: none repeat scroll 0 0 #abcdef;
border: 1px solid #000;
}
</style>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$('.plusbtn')
.click(
function() {
$(".test")
.append(
'<tr><td><input type="text" class="txtbox" value="" /></td><td><input type="text" class="txtbox" value="" /></td><td><input type="text" class="txtbox" value="" /></td><td><input type="text" class="txtbox" value="" /></td></tr>');
});
$('.minusbtn').click(function() {
if ($(".test tr").length != 2) {
$(".test tr:last-child").remove();
} else {
alert("You cannot delete first row");
}
});
</script>
</body>
</html>
vib3.html 個
我嘗試使用會話cookie。 –
它不接受代碼,所以不得不刪除不正確的代碼。我是堆棧交換的新手。不知道如何發佈問題。抱歉。 –
但是真的Viber,你被提示要經過很多屏幕,詢問你是否理解你在做什麼。如果你仍然設法提出一個壞問題,那麼這完全在你身上。你可以使用cookies(他們工作),JavaScript的變量或值的URL。 – Mathemats