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 titleUntitled/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;idocument.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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: OT: Javascript: I can't reference input type=image... HELP!
Someone told me that it's impossible... therefore now I'm using an input tag if there's no script, or an image link which submits when they click if there is javascript. David andrew kopelman wrote: 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 titleUntitled/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;idocument.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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: OT: Javascript: I can't reference input type=image... HELP!
you can use the onClick= event of an img to submit a form. whateverform.submit() or you could even enclose the image within a href and have that run a whateverform.submit() Fred - Original Message - From: "David Cummins" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Wednesday, March 07, 2001 6:20 PM Subject: Re: OT: Javascript: I can't reference input type=image... HELP! Someone told me that it's impossible... therefore now I'm using an input tag if there's no script, or an image link which submits when they click if there is javascript. David andrew kopelman wrote: 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 titleUntitled/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;idocument.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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: OT: Javascript: I can't reference input type=image... HELP!
yes, i could. only, could I then change the src of that img thru a javascript function? Thanks, Andrew From: "Fred T. Sanders" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: Re: OT: Javascript: I can't reference input type=image... HELP! Date: Wed, 07 Mar 2001 18:25:03 -0500 you can use the onClick= event of an img to submit a form. whateverform.submit() or you could even enclose the image within a href and have that run a whateverform.submit() Fred - Original Message - From: "David Cummins" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Wednesday, March 07, 2001 6:20 PM Subject: Re: OT: Javascript: I can't reference input type=image... HELP! Someone told me that it's impossible... therefore now I'm using an input tag if there's no script, or an image link which submits when they click if there is javascript. David andrew kopelman wrote: 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 titleUntitled/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;idocument.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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists