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

Query Search Database with input

Guest
Jul 17, 2008 Jul 17, 2008
Hi,

I am new to CF - I am building a FAQ form which queries the database based on the input of the user. The Search page and results page are one [faq.cfm] - I get the following error
quote:

Element INPUT is undefined in FORM1.


Here is my code
TOPICS
Getting started
225
Translate
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

correct answers 1 Correct answer

LEGEND , Jul 17, 2008 Jul 17, 2008
The name of the form, 'Form1' in this example, is only relevant on the
client and is used in JavaScript type client side processing.

On the server, data submitted from a 'post' request is always contained
in the 'form' scope and is referenced as such, irrespective of what the
from was named on the client.

So your code should just be: LIKE '#FORM.input#'.

Naming your controls more specifically then 'Form1' and 'input' would
make for more easily understood source code.

Also, it is a great ...
Translate
LEGEND ,
Jul 17, 2008 Jul 17, 2008
The name of the form, 'Form1' in this example, is only relevant on the
client and is used in JavaScript type client side processing.

On the server, data submitted from a 'post' request is always contained
in the 'form' scope and is referenced as such, irrespective of what the
from was named on the client.

So your code should just be: LIKE '#FORM.input#'.

Naming your controls more specifically then 'Form1' and 'input' would
make for more easily understood source code.

Also, it is a great habit to get used to using <cfqueryparam...> in all
your <cfquery...> blocks. Learn it early and it saves retraining
oneself later.
Translate
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
Guest
Jul 17, 2008 Jul 17, 2008
LATEST
Thank you 🙂
Translate
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