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

Form not returning variable - getting Variable is Undefined

Community Beginner ,
May 21, 2012 May 21, 2012

I have a simple form with a simple insert statement. I keep getting this error:

Variable 'firstname' is UNDEFINED

This is just part of my form. I only am using this part because if I can't get firstname to insert then the rest doesn't matter.

<form action="submitform.cfm" method="post">

<input type ="text" name="firstname" value="" size="25" >

</form >

That goes to this query:

<cfquery name="qinsert" datasource="name" >

INSERT INTO tablename (firstname)

VALUES ('#firstname#')

</cfquery>

I have done <cfdump> and it returned 'empty'.  I can't figure out why the variables aren't passing through.

Thank you!!!

TOPICS
Getting started
774
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
LEGEND ,
May 21, 2012 May 21, 2012

Are these two bits of code on the same page?

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
Community Expert ,
May 23, 2012 May 23, 2012
LATEST

I will assume that the query is in the form's action page, submitform.cfm. What is then lacking is an event to submit the form. Add, for example, a submit button to the form.

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