Actually a regular image should be able to submit your form:
<form name="whateverForm" action="imgtest.cfm" method="post"
enablecab="Yes">
<input type="text" size="20" name="myTextEntry" onblur="callMe();">
<a href="javascript: document.whateverForm.submit()"><img
name="myInputImage" src="../../images/cancel.gif" ></a>
<img src="../../images/save.gif" name="andrewImage">
<input type="Hidden" name="aname" value="anyvalue">
and you should be able to swap the images by referencing
document.whateverForm.src
Hope that helps.
-Craig
[EMAIL PROTECTED]
-----Original Message-----
From: andrew kopelman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 07, 2001 10:59 PM
To: CF-Talk
Subject: OT: Javascript: I can't reference <input type=image... HELP!
Hi,
I know this is off topic, but maybe someone has seen this problem before?
I want to reference in javascript my: <input type="image"
name="myInputImage" src="../../images/cancel.gif">. I want to do this in
order that I can switch its image (and make it essentially dissappear). Its
not even showing up in my debug loop of all form elements! And throws an
error if I try to display it in alert box (so is commented out). A regular
<img ...> does work, but i can't use it to submit the form. Any ideas?
Thanks in advance,
Andrew
<html>
<head>
<title>Untitled</title>
<script language="JavaScript1.2">
<!--
function callMe(){
alert("image: "+document.andrewImage.src);
//alert("input image:
"+document.whateverForm.myInputImage.name);
document.andrewImage.src="../../images/new.gif";
for(i=0;i<document.whateverForm.elements.length;i++) {
alert("element:" + i + "value:" +
document.whateverForm.elements[i].value);
}
}
//-->
</script>
</head>
<body>
<form name="whateverForm" action="imgtest.cfm" method="post"
enablecab="Yes">
<input type="text" size="20" name="myTextEntry" onblur="callMe();">
<input type="image" name="myInputImage" src="../../images/cancel.gif">
<img src="../../images/save.gif" name="andrewImage">
<input type="Hidden" name="aname" value="anyvalue">
</form>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists