Exforsys
+ Reply to Thread
Results 1 to 4 of 4

ColdFusion checkbox

This is a discussion on ColdFusion checkbox within the Coldfusion forums, part of the Programming Talk category; How to fetch the value from checkbox selected in one page to other page linked by submit button.?...

  1. #1
    Seema Patil1 is offline Junior Member Array
    Join Date
    Jan 2011
    Answers
    1

    ColdFusion checkbox

    How to fetch the value from checkbox selected in one page to other page linked by submit button.?


  2. #2
    techvinny is offline Moderator Array
    Join Date
    Dec 2010
    Answers
    56
    Assuming the checkbox on your 1st page is as follows,

    Code:
          <cfinput type="checkbox" name="chkNotifyMe" value="Yes">
    On the action page, if the checkbox is not checked then it will not be available in the form scope when submitted. So, you could see if it exists in the form scope by IsDefined like this,
    Code:
    <cfif IsDefined("Form.chkNotifyMe'">
      <!-- use the checkbox -->
    <cfelse>   
      <!-- Something else -->
    </cfif>
    or, you could use cfparam like this,
    Code:
    <cfparam name="Form.chkNotify" default="No">
    <cfif Form.chkNotifyMe EQ "Yes">
      <!-- notify the user -->
    <cfelseif Form.chkNotifyMe EQ "Yes">
      <!-- do not notify the user -->
    </cfif>
    HTH!!!


  3. #3
    webcurious is offline Junior Member Array
    Join Date
    Apr 2012
    Answers
    12
    This little bit helps more than I thought it would. Now I'm off to the rest of the tutorials...


  4. #4
    goodmark is offline Junior Member Array
    Join Date
    Apr 2012
    Answers
    15
    So, what instances would this type of checkbox be used versus another type, such as PHP? Sometimes I have a hard enough time learning these programming script languages and then I can't decide how to apply them-or when to apply them.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...