I need a function for my onFocus call, see below. I am trying to pass the text in my search box and assign it to the variable labeled SEARCH. This varible will be called by another page, which uses the following <cfoutput>#search#</cfoutput> to call the variable.
I just need to get the javascipt function to work?
Thank you, awieland
<form action="index.cfm" method="get" >
<label>search
<input name="search2" type="text" value="SEARCH" onFocus="if(this.value=='SEARCH')this.value='';" size="15" />
</label>
<input name="search" type="Image" src="../resources/images/but_go.gif" value="submit" />
</form>
********************************************************
<script type="text/javascript" language="JavaScript">
function if(this.value=='SEARCH') {
document.Form.search2.value = SEARCH
}
</script>
I just need to get the javascipt function to work?
Thank you, awieland
<form action="index.cfm" method="get" >
<label>search
<input name="search2" type="text" value="SEARCH" onFocus="if(this.value=='SEARCH')this.value='';" size="15" />
</label>
<input name="search" type="Image" src="../resources/images/but_go.gif" value="submit" />
</form>
********************************************************
<script type="text/javascript" language="JavaScript">
function if(this.value=='SEARCH') {
document.Form.search2.value = SEARCH
}
</script>