I have my search box in one frame and my results displayed in another frame. Everything is working well except that we I have done a search and I try to click back on the search box to try a different search I have to click on the first letter and then delete the word from the previous search. Is there a way to automaticly clear the contents in the search box and refresh it?
Announcement
Collapse
No announcement yet.
Search Box Behavior - automatically clear the content
Collapse
X
-
These past posts might help,
Can I have "enter search term here" appear in search box?
Way to clear search input box after submitting search
-
Originally posted by wrensoft View PostThese past posts might help,
Can I have "enter search term here" appear in search box?
Way to clear search input box after submitting search
<script language="javascript">
function cleartext()
{
document.form1.zoom_query.value = "";
}
</script>
<form name="form1" action="../Zoom_Search/search.asp" target="MainContentFrame" onSubmit="cleartext();">
<input type="text" name="zoom_query" size="13" value="">
<input type="submit" value="Search">
</form>
Comment
-
Seems like a flaw in that original concept. It might be better changing the submit button and adding an onClick function.
e.g.
Code:<script language="javascript"> function submitandclearsearch() { document.form1.submit(); document.form1.zoom_query.value = ""; } </script> <form name="form1" action="../Zoom_Search/search.asp" target="MainContentFrame"> <input type="text" name="zoom_query" size="13" value=""> <input type="button" value="Search" onclick="submitandclearsearch();"> </form>
Comment
-
Ah. So demanding
Code:<script language="javascript"> function submitandclearsearch() { document.form1.submit(); document.form1.zoom_query.value = ""; } </script> <form name="form1" action="../Zoom_Search/search.asp" target="MainContentFrame"> <input type="text" name="zoom_query" size="13" value="" onkeydown="if (event.keyCode == 13) document.getElementById('zoomSearchButton').click();"> <input type="button" value="Search" id="zoomSearchButton" onclick="submitandclearsearch();"> </form>
Comment
Comment