Copy link to clipboard
Copied
this code is worked fine with onchange event. Instead of onchange, i want to have the link below(<a id="myLink" href="##" onclick="whatsUp();">link text</a>) and work the same as onchange, meaning when i
click on the link text , i need to get the url.t_item?
<script type="text/javascript">
function whatsUp() {
document.medform.t_item.value)
}
function show() {
alert(document.medform.t_item.value)
}
</script>
<cfif isDefined("form.t_item")>
<cfdump var="#form#"><br />
</cfif>
<cfform name="medform" action="#cgi.SCRIPT_NAME#">
Item name: <cfinput autosuggest="cfc:cfc.gg.lookupArt({cfautosuggestvalue})" type="text" name="t_item" size="50" typeahead="yes" onChange="whatsUp()">
<a id="myLink" href="##" onclick="whatsUp();">link text</a>
</cfform>
Copy link to clipboard
Copied
Looks pretty much ok, so what happens when you click on the link? There is a missing alert in your whatsUp() function but I think you know that.
Copy link to clipboard
Copied
Your whatsUp() function appears to have a typo: I see a closing paren but no opeing one and I don't see what it doing anything even if you correct the stray paren. Maybe you meant to call alert()?