Alright, I give...
The code for the form and the text input field of concern:
<Form Name="PropertySearchForm" Action="" Method=POST>
<CFIF IsDefined("Form.Search")>
<INPUT Name="Keyword" Type="Text"
Value="<CFOUTPUT>#Form.Keyword#</CFOUTPUT>"
Size="30" MaxLength="30" Class="TextInput01">
<CFELSE>
<INPUT Name="Keyword" Type="Text" Value="" Size="30" MaxLength="30"
Class="TextInput01">
</CFIF>
</Form>
I checked for the presence of Form.Search when the Enter key is hit while
the cursor
is in the Keyword Text Input Field and it was not present.
Click outside the Keyword Text Input Field and hit the Enter key and
"Form.Search"
is present.
The form is submitting back to the page which it's on, if that
matters...everything works fine
except when the cursor is in the Keyword field when the Enter key is hit.
The cursor can be in the
Keyword field when the "Search" button is clicked and everything works
fine...go figure...
Hmmm....I just check something else, also. When I select a city for the
search (this is a real estate
application) and put the cursor in the Keyword field and hit the Enter key,
the value for the city is passed
by the form, but the value for Form.Search (The Search Button) is not
present...
(Pause...trying out an idea...) Well, the trick is to have a hidden field in
the form and to check
for its presence instead of checking for the presence of the value of the
Search button. When the
form is submitted by hitting the Enter key, the Search button value is not
passed. But the hidden field
is passed and can be used to trigger the search action involving the Keyword
field. You can see from
the code above that the Keyword field value was not factored in if the
Form.Search field was not defined.
So now I've learned something new...don't use the submit button value or
presence as a trigger,
use the value or presence of a hidden field...
Rick
-----Original Message-----
From: Aaron DC [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 28, 2004 2:31 AM
To: CF-Talk
Subject: Re: Text Input Field Data not recognized with use of Enter key
Really? Google works fine when you hit enter, with the cursor still in the
textbox. A quick check locally... works fine for me too
<FORM ACTION="" METHOD="POST"><INPUT NAME="lalal"></FORM>
I type lalala in the textbox and hit enter and form.lalal = lalala
The plot thickens! It may be time for you to share some code!
Aaron
----- Original Message -----
From: Rick Faircloth
To: CF-Talk
Sent: Wednesday, July 28, 2004 4:23 PM
Subject: RE: Text Input Field Data not recognized with use of Enter key
That is true when the cursor is not in the text field at the time the
Enter key is hit, but if the cursor is still in the text field, the value
of the field is not passed on...at least that's what's happening in this
case.
Rick
-----Original Message-----
From: Aaron DC [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 28, 2004 12:15 AM
To: CF-Talk
Subject: Re: Text Input Field Data not recognized with use of Enter key
Without seeing your code I cant say 100%, but when a form is submitted
(either through clicking submit or hitting the enter key), the textbox
form
field should always be present.
Aaron
----- Original Message -----
From: Rick Faircloth
To: CF-Talk
Sent: Wednesday, July 28, 2004 2:08 PM
Subject: RE: Text Input Field Data not recognized with use of Enter key
Hi, Aaron...
So you're saying that the textbox field value is not being passed
and the "Search" button value is? That makes sense, because
if the "Search" button value was not being passed, the form and none
of its fields would be processed.
That still leaves a problem...if a user fills in the textbox field, and
doesn't click out of the field before hitting the Enter key, then the
textbox value isn't passed...at least that's what happened when I
tested.
It seems they'll just have to be instructed to use the Search button for
submitting
the form and not the Enter key...
Rick
-----Original Message-----
From: Aaron DC [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 11:40 PM
To: CF-Talk
Subject: Re: Text Input Field Data not recognized with use of Enter
key
You dont have to - just check for the existence of the textbox field.
Aaron
----- Original Message -----
From: Rick Faircloth
To: CF-Talk
Sent: Wednesday, July 28, 2004 1:41 PM
Subject: RE: Text Input Field Data not recognized with use of Enter
key
Hi, Matthew, and thanks for the reply...
You're right...the action is dependent upon the "Search" button value
being
passed.
I guess the solution is to pass another value that will be passed if
the
Search button
is clicked or the Enter key is hit. I guess a hidden field would do
the
trick...
Thanks, again...
Rick
-----Original Message-----
From: Matthew Walker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 6:07 PM
To: CF-Talk
Subject: RE: Text Input Field Data not recognized with use of Enter
key
When the button is clicked, the associated button value is passed to
the
form handler. When enter is hit, the button value is not passed.
Apparently,
your handler page is relying on that button value.
_____
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 28 July 2004 7:22 a.m.
To: CF-Talk
Subject: Text Input Field Data not recognized with use of Enter key
Why would a form which has a Text Input field for keywords not
put the keywords into play on the action if the Enter key is used
to submit the form instead of the "Submit" (in this case "Search")
button is clicked?
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Text Input Field Data not recognized with use of Enter key Rick Faircloth
- RE: Text Input Field Data not recognized with use of E... Matthew Walker
- RE: Text Input Field Data not recognized with use ... Rick Faircloth
- Re: Text Input Field Data not recognized with ... Aaron DC
- RE: Text Input Field Data not recognized w... Rick Faircloth
- Re: Text Input Field Data not recogni... Aaron DC
- RE: Text Input Field Data not rec... Rick Faircloth
- Re: Text Input Field Data not... Aaron DC
- Re: Text Input Field Data not... Rick Faircloth
- Re: Text Input Field Data not... Aaron DC
- RE: Text Input Field Data not... Rick Faircloth
- Re: Text Input Field Data not... Aaron DC
- RE: Text Input Field Data not... Rick Faircloth