I'm by no means experienced at JS programming, and I worked out this script to combine the contents of three form elements and send the combined result to a CGI script. The only problem is, instead of putting spaces in between the terms like it was supposed to, it puts + signs between them. Can anybody help?
The code is this:
<script language="JavaScript"><!--
function textBuild() {
document.search.searchstring.value = document.search.elements[1].value+' '+document.search.elements[2].value+' '+document.search.elements[3].value
}
//--></script>
<form name="search" action=" onSubmit="textBuild()" target="view">
<input type="hidden" name="searchstring">
<input type="text"><input type="text"><input type="text"><input type="submit" value="Search" target="view">
So, for example, if the word "fish" was typed into all three search boxes, I want the string returned to be "fish fish fish", whereas it comes out as "fish+fish+fish".
Can anybody help?
Thank you,
Ian
moonshadow@talk21.com
The code is this:
<script language="JavaScript"><!--
function textBuild() {
document.search.searchstring.value = document.search.elements[1].value+' '+document.search.elements[2].value+' '+document.search.elements[3].value
}
//--></script>
<form name="search" action=" onSubmit="textBuild()" target="view">
<input type="hidden" name="searchstring">
<input type="text"><input type="text"><input type="text"><input type="submit" value="Search" target="view">
So, for example, if the word "fish" was typed into all three search boxes, I want the string returned to be "fish fish fish", whereas it comes out as "fish+fish+fish".
Can anybody help?
Thank you,
Ian
moonshadow@talk21.com