Hi got a simple frame problem. I have 2 frames a top and a bottom frame. A html file opens in the top frame(final.html) and a php file in the bottom frame(final.php)
When i enter data it the top frame it should post to the bottom frame but it doesnt. It just loads final.php in the top frame with the search results.
The frame html code follows:
<HTML>
<HEAD>
<TITLE>A simple frameset document</TITLE>
</HEAD>
<FRAMESET rows="50, 100">
<FRAME src="final.html">
<Frame src="final.php">
</FRAMESET>
<NOFRAMES>
<P>This frameset document contains:
</NOFRAMES>
</FRAMESET>
</HTML>
Final.html coding:
<html>
<head>
<title>Search</title>
</head>
<body>
<h1>Database search</h1>
<form action="final.php" method="post">
Choose Search Type:<br />
<select name="searchtype">
<option value="pdb_code">PDB Code</option>
<option value="smile_string">Smile String</option>
</select>
<br />
Select Operator Type:<br />
<select name="operator">
<option value="LIKE">Contains</option>
<option value="=">=</option>
</select>
<br />
Enter Search Term:<br />
<input name="searchterm" type=""text" si开发者_开发百科ze="40"/>
<br />
<input type="submit" name="submit" value="Search"/>
</form>
</body>
</html>
You need to give the frame a name and then target it in your form.
To illustrate David's answer, use this code for your frameset :
<HTML>
<HEAD>
<TITLE>A simple frameset document</TITLE>
</HEAD>
<FRAMESET rows="50, 100">
<FRAME src="final.html" name="top">
<Frame src="final.php" name="bottom">
</FRAMESET>
<NOFRAMES>
<P>This frameset document contains:
</NOFRAMES>
</FRAMESET>
</HTML>
And this code for final.html:
<html>
<head>
<title>Search</title>
</head>
<body>
<h1>Database search</h1>
<form action="final.php" method="post" target="bottom">
Choose Search Type:<br />
<select name="searchtype">
<option value="pdb_code">PDB Code</option>
<option value="smile_string">Smile String</option>
</select>
<br />
Select Operator Type:<br />
<select name="operator">
<option value="LIKE">Contains</option>
<option value="=">=</option>
</select>
<br />
Enter Search Term:<br />
<input name="searchterm" type=""text" size="40"/>
<br />
<input type="submit" name="submit" value="Search"/>
</form>
</body>
</html>
精彩评论