Copy link to clipboard
Copied
I'm unable to use a keypress "enter" key to submit a rich internet form for action. Is this normal or is there a setting on the cfinput to allow a keypress to submit form?
Copy link to clipboard
Copied
Hi,
Try something like this,
P.S : Modify the code according to your need.
<cfform action="" method="post" name="searchform" format="flash" id="searchform" timeout="180" height="250">
<cfformgroup type="tile">
<cfinput
type="text"
name="searchtext"
required="yes"
id="searchtext"
width="150"
message="You must enter text in the search field"
onKeyDown="if(Key.isDown(Key.ENTER)) {submitForm()}"
>
<cfinput type="submit" name="search" value="Search" id="submit" tabindex="0">
</cfformgroup>
</cfform>
HTH
Copy link to clipboard
Copied
After doing EVEN MORE research, I finally found the answer is in the Accessibility attribute of your form. Once you set it to "yes" it is the spacebar that initiates the form submission instead of the "Enter" key. Kind of a bummer, but I think it's due to the functionality of the screen reader devices that blind people use to read these forms and not a shortcomming of Adobe. I think this anser can be used to "force" the submit button to work upon the key press of the "Enter" field. Thanks for the code!