Forum Moderators: open
And another question: how to open the code below in iframe?
<input name="searchbutton" type="button" value="Go" onclick="javascript:SearchForWords()">
because when run that code it will open automatically in a different window. but I want it to open in an iframe.
This is the complete code of my project:
<HTML>
<HEAD>
<TITLE>Search</TITLE>
<!-- BEGIN_SEARCH_SCRIPT -->
<!-- Helpware Search data generated by FAR.EXE [helpware.net...] -->
<script language="JavaScript" src="searchdata.js"></script>
<!-- Search Code to find words -->
<script language="JavaScript" src="search.js"></script>
<!-- END_SEARCH_SCRIPT -->
</HEAD>
<BODY bgcolor="white">
<!-- BEGIN_SEARCH_FORM -->
<form name="searchform">
<script language="javascript">
function SearchForWords() {DoSearch('', searchform.searchdata1.value, '', false, 'right');}
function KeyDownEvent() {if ((event.which && event.which==13) ¦¦ (event.keyCode && event.keyCode==13)) {
SearchForWords(); return(false); } else return(true);}
function show() {
document.getElementById('iframe1').src=javascript:SearchForWords();
}
</script>
<b>Search for Word:</b> <br>
<input type="text" name="searchdata1" style="width:180" onKeyDown="javascript:return(KeyDownEvent());">
<input name="searchbutton" type="button" value="Go" onclick="javascript:show()">
</form>
<!-- END_SEARCH_FORM -->
<table width=40% cellpadding=4 cellspacing=0 border=0>
<form name=form>
<tr>
<td nowrap>
<select name="fieldname" size="1"
onChange="window.open(this.options[this.selectedIndex].value,'iframe1')">
<option value="PSL.htm"> </option>
<option value="A_option.htm">A</option>
<option value="index.htm">B</option>
</select>
</td>
<b>Select By Letters</b> </tr>
</form>
</table> <!--End of jumpMenu-->
<table>
<tr>
<td width="220" valign="top">
<p align="center">
<!-- ####################### start of iframe tags ####################### -->
<!-- ####################### the text between the start and end tags of the iframe is similar to the noframes tag in regular frames ####################### -->
<iframe name="iframe1" src="PSP Dictionary.htm" align="top" height="200" width="250" hspace="10" vspace="10">
If you can see this, your browser does not support iframes!
</iframe>
<!-- ####################### end of iframe tags ####################### -->
</td>
</tr>
</table>
</BODY>
</HTML>
You need to consider how large "words.html" is, if large then best to do the search on the server rather than in javascript, otherwise download time must be considered.
If you wish to do it on the client, consider loading "words.html" into hidden iframe so that it does not need to downlosd on each of your pages.