Skip navigation
Currently Being Moderated

Cannot get CFINPUT to submit Form.Submit when using an image

Feb 19, 2012 8:17 AM

Tags: #image #cfinput #form.submit

<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?

  • Currently Being Moderated
    Feb 19, 2012 8:23 AM   in reply to Karolus

    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:




    Mark as:
  • Currently Being Moderated
    Feb 20, 2012 3:46 AM   in reply to Karolus

    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.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points