Copy link to clipboard
Copied
<CFINPUT type="image" name="Submit" value="Submit" src="../../../Media/Images/CommentForm/Submit.jpg" align="middle">
This is the code I'm using to try to get FORM.Submit on the action page. I'm using an image, but when I click on the image, I get an error that the FORM.Submit does not exist on (was not passed to) the action page.
Anyone know what I'm doing wrong?
Copy link to clipboard
Copied
The first thing one should ever do whenever one is not getting the form field values one's expecting is to dump the form scope out and see what one did get.
I reckon if you do that, you'll see where you're going wrong.
It might also pay to read up on the HTML spec, in particular the bit on form fields:
http://www.w3.org/TR/html4/interact/forms.html#input-control-types
--
Adam
Copy link to clipboard
Copied
If ColdFusion told you form.submit does not exist on the action page, then ColdFusion would have lied a bit. It in fact exists, but not in way you expect. Ask yourself this: what do you expect to be posted to the action page when you click on the image? Adam answers the puzzle.
The name we give something can affect how we subsequently think about it. I would name the tag as follows:
<CFINPUT type="image" name="img" src="../../../Media/Images/CommentForm/Submit.jpg" align="middle">
This reduces the possibility of confusion, and also ties in naturally with the value in the action page.