Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 369273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:54:14+00:00 2026-05-12T13:54:14+00:00

The Form variable in my form is being passed/retrieved via Session. I have a

  • 0

The Form variable in my form is being passed/retrieved via Session.

I have a troublesome Form variable(formField1) that was NOT DEFINED properly in the Session, but the whole form was put into use. Then this particular Form variable(formField1) was filled and used, trapping it in the Session and throwing an error. I gave a stop gap solution:

 <cfif isDefined("TTsession.filing.formField1")>
       <cfset TTD formField1 = TTsession.filing.formField1>
     <cfelse>
       <cfset TTD formField1 = "0">
     </cfif>

TTsession= name of the Session variable
formField1= name of the erroneous form field.

As a result of which all the forms in which TTsession.filing.formField1 was improperly defined are giving an output of 0.

I do not want this. What I want to do is:

  1. Check Does form variable EXIST in session?
  2. If yes,
    <cfset FormVar1=session.FormVar1>
  3. If no,
    1. KILL THE MISSING form variable in that Session.
    2. re-Define the form variable FormVar1 right here in that Session.
      <cfset FormVar1=session.FormVar1>

I am using CFMX6.1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:54:14+00:00Added an answer on May 12, 2026 at 1:54 pm
    <cfparam name="FormVar1" default="0">
    
    <!--- set overide defaults if in the session --->
    <cfif StructKeyExists( TTsession.filing, "formField1")>
       <cfset FormVar1 = TTsession.filing.formField1>
    </cfif>
    

    I think the problem might be where you have created this session, however if you merely want to set defaults just use cfparam :

     <cfparam name="session.filling.formfield1" type="numeric" default="0">
    

    So if the session var is defined, do nothing. Else define it with the value of zero. All in one line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 281k
  • Answers 281k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I might see it too simply (and sorry I can't… May 13, 2026 at 3:46 pm
  • Editorial Team
    Editorial Team added an answer I think it's a good idea. Having an asynchronous area… May 13, 2026 at 3:46 pm
  • Editorial Team
    Editorial Team added an answer Use something like this: if(window.addEventListener){ sNode.options[x+1].addEventListener('click', fixDayList, false); } else… May 13, 2026 at 3:46 pm

Related Questions

In the application there is a default report the user see's listing all the
I'm generating a ton of XML that is to be passed to an API
I have a several input fields in a form each having a unique name.
I'm a total python noob so please bear with me. I want to have

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.