Forum Moderators: open
The agency we are working with requests that we add a 1x1px gif that is only displayed when the "search" button is clicked.
Is it possible to combine the code to search and also display the img tag as part of the onclick event?
Current onlick code
<INPUT type="image" src="/images/css/find-hotel.gif" name="SearchWiz" value="Find A Hotel" title="Find A Hotel" border="0" onclick="javascript:document.HotForm.submit(); "/>
Image tracking tag
<img height="1" width="1" src="www.example.gif"/>
Any help is appreciated
<INPUT type="image" src="/images/css/find-hotel.gif" name="SearchWiz" value="Find A Hotel" title="Find A Hotel" border="0" onclick="function(){
var img = new Image();
img.src = "www.example.gif";
document.HotForm.submit();
}
"/>
[edited by: Fotiman at 9:04 pm (utc) on Jan. 9, 2008]
Below is what I am working with:
<FORM NAME=HotForm ACTION="http://example.com/form.asp" METHOD=get>
<INPUT name=eapid type=hidden value="22436-30021">
<INPUT TYPE=HIDDEN NAME=GOTO VALUE="HOTSEARCH">
<INPUT TYPE=hidden NAME=rfrr VALUE="-34980">
<INPUT TYPE=hidden NAME=olid VALUE="">
<INPUT TYPE=hidden NAME=mdpcid VALUE="22436-30021.0.1">
</FORM>
<SCRIPT language=”JavaScript”>
<!--
function submitForm() {
http://example.tracking-image
// submit
document.HotForm.submit():
}
-->
</SCRIPT>
If possible could you point me in the right direction or to search phrase for a tutorial that would help?
Thanks
<form name="HotForm" action="http://example.com/form.asp" method="get"
onsubmit="function(){var img=new Image();img.src="example.gif";}"
>
<input name="eapid" type="hidden" value="22436-30021">
<input type="hidden" name="goto" value="HOTSEARCH">
<input type="hidden" name="rfrr" value="-34980">
<input type="hidden" name="olid" value="">
<input type="hidden" name="mdpcid" value="22436-30021.0.1">
<input type="image" src="/images/css/find-hotel.gif" name="SearchWiz" value="Find A Hotel" title="Find A Hotel" border="0">
</form>