我使用了以下代码:
Form1.html
<html>
<head>
<title>Table of Data</title>
</head>
<body>
<form method="POST">
<table border="1" id="tblQuery">
<tr>
<th>Query</th>
<th>Answer</th>
<th>Data Type</th>
<th>Screen No.</th>
</tr>
<tr>
<td>Name</td>
<td><input type="text"/></td>
<td>Textbox</td>
<td>1</td>
<td><input type="button" value="Edit" /><input type="button" value="Delete" /></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="gender" value="male" />Male<br><input type="radio" name="gender" value="female" />Female</td>
<td>Radio Buttons</td>
<td>2</td>
<td><input type="button" value="Edit" /><input type="button" value="Delete" /></td>
</tr>
<tr>
<td>Qualification</td>
<td><input type="checkbox" name="qualification" value="graduate" />Graduate<br><input type="checkbox" name="qualification" value="post graduate" />Post Graduate</td>
<td>Checkbox</td>
<td>1</td>
<td><input type="button" value="Edit" /><input type="button" value="Delete" /></td>
</tr>
<tr>
<td>City</td>
<td><select>
<option value="new_delhi">New Delhi</option>
<option value="mumbai">Mumbai</option>
<option value="kolkata">Kolkata</option>
<option value="chennai">Chennai</option>
</select></td>
<td>Select List</td>
<td>4</td>
<td><input type="button" value="Edit" /><input type="button" value="Delete" /></td>
</tr>
<tr>
<td>Academic Record</td>
<td><input type="button" value="Add Table" onclick="addTable.html" /></td>
<td>Table</td>
<td>3</td>
<td><input type="button" value="Edit" /><input type="button" value="Delete" /></td>
</tr>
</table>
<br>
</form>
</body>
</html>
Form2.html
<html>
<head>
<title>Action</title>
<script src="scripts/newQuery.js"></script>
</head>
<body>
<input type="button" value="Add Query" onclick="openPage()" />
<input type="button" value="Create Metafile" />
</body>
</html>
后来,我使用元素将两个页面添加到"index.html"
文件中"frameset"
,如下所示:
索引.html
<html>
<head>
<title>Main Application case Study</title>
</head>
<frameset rows="75%, *">
<frame src="Form.html" />
<frame src="Form2.html" />
</frameset>
</html>
现在,如果我打开"index.html"
页面并单击"Add Query"
按钮,我会收到一条"prompt"
消息,要求我添加我的查询并将其添加到"Form1.html"
页面。
我在这里面临的问题是,当我提交要添加到表中的查询时,查询实际上是提交到"Form2.html"
页面,因为在"prompt"
该页面上编码。但我需要在"Form1.html"
.
我怎样才能实现它?