I've got a script that, when a form is submitted it checks for a description that is written in a text area and a URL that is displayed as a link underneath but when the link is printed it replaces everything on the screen rather than just printing below the text area. Here's a bit of my code:
function get_defn(term_string)
{
window.onerror = undefined_term;
defn_string = eval(term_string.replace(/ /g,"_"
.toUpperCase());
defn_array = defn_string.split("="
;
return defn_array[0]
};
function write_link()
{
document.writeln("<a href='" + defn_array[1] + "'>Link</a>);
}
//the functions are called like so:
<input type="button" name="B1" value="Search!" onclick="javascript:document.form1.output.value = get_defn(document.form1.searchtext.value); write_link();">
Please help.
function get_defn(term_string)
{
window.onerror = undefined_term;
defn_string = eval(term_string.replace(/ /g,"_"
defn_array = defn_string.split("="
return defn_array[0]
};
function write_link()
{
document.writeln("<a href='" + defn_array[1] + "'>Link</a>);
}
//the functions are called like so:
<input type="button" name="B1" value="Search!" onclick="javascript:document.form1.output.value = get_defn(document.form1.searchtext.value); write_link();">
Please help.