I want the results text to be divs. I don't care if there is a table or not. If someone enters acceptable text, a set of div's could be called as the result. Then the same text would not have to be rewritten for each result that needs that text. In the stuff above if "goes with" "a" and "b" were text by themselves in 3 div's, those divs would be called if someone entered a or b.
Everything below is working and finished, except I tried to do div's and now it won't work again.
<html><head></head><body onload="document.notarealform.textfield.focus()">
<script type="text/javascript">
<!--
document.write("<H>A heading</H><br /><br /><br />");
function youentered(){
var item = document.getElementById('item').value;
document.getElementById('entereditem').innerHTML = item;
document.getElementById('explanation').innerHTML = 'Your search entry: ';
}
function itemresults(){
var itemField = document.getElementById('item');
if (itemField.value == "a") {
document.getElementById("show").innerHTML = "put a combination of div's something like this with the words written elsewhere so they don't have to be rewritten ---> <div 1, div 2, div 3">;
} else if (itemField.value == "b") {
document.getElementById("show").innerHTML = "put a combination of div's something like this with the words written elsewhere so they don't have to be rewritten ---> <div 2, div 1, div 4>";
} else if (itemField.value == "") {
document.getElementById("show").innerHTML = "Please enter some text.";
} else {
document.getElementById("show").innerHTML = "Not found.";
}
}
//-->
</script>
<div id="1" bgcolor="f0faf5">some text for div 1</div>
<div id="2" bgcolor="f0faf5">some text div 2</div>
<div id="3" bgcolor="f0faf5">other text div 3</div>
<div id="4" bgcolor="f0faf5">different text div 4</div>
<p><br /><br />Enter some text.<p />
<p><i id='explanation'>Your entry: </i><b id='entereditem'>none</b></p>
<form method="post" name="notarealform">
<input type='text' name="textfield" id='item' onkeyup='youentered()' /> <input type='button' onclick='itemresults()' value='Look It Up'/></form>
</body></html>
