• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Feb 19, 2012 Feb 19, 2012

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?

Views

968

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2012 Feb 19, 2012

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2012 Feb 20, 2012

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation