Problems with radio buttons/cookies

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Problems with radio buttons/cookies

    I'm re-posting this message because I'm not sure why it was ignored. Does no
    one know the answer, or do I need to give you more of my code to check?

    I'm sorry about re-posting.

    Hi,

    I've been trying to get my head aorund these blasted things, but I just can't
    seem to. I'm sorry to just come here and expect you guys to answer, but I do
    honestly try to understand it before coming here, and clogging the forums up
    with basic questions. I'm working with Web Monkey articles, and they don't
    explain how to use cookies too well...

    I have some radio buttons (attatched), a process that should set cookies
    (attatched), and something to tell me wether it has (attatched).

    All the different parts of the attatched code are in seperate templates.

    It will output the session, but never outputs the cookies - Always come up
    with cookie undefined. :/

    What am I doing wrong?

    I'm sure I don't have the CFIF's right for the radio buttons. Shoudl they be
    "1" "#1#" or just 1?

    SIGH

    Again, I apologise for this basic question.

    Any help would be much appreciated,
    JR

    <!-- RADIO BUTTONS -->

    Remember my Username <cfinput type="radio" value="1" required="no"
    checked="yes" name="remember"><br>
    Remember my Username and password <cfinput type="radio" value="2"
    required="no" checked="no" name="remember"><br>
    Always ask for my Username and password <cfinput type="radio" value="0"
    required="no" checked="no" name="remember"><br>

    <!-- PROCESS -->

    <cfif 1=("form.remember")>
    <cfcookie name="UserName" value="#GetUser.UserName#" Expires="NEVER">
    </cfif>
    <cfif 2=("form.remember")>
    <cfcookie name="UserName" value="#GetUser.UserName#" Expires="NEVER">
    <cfcookie name="pass" value="#GetUser.password#" expires="never">
    </cfif>
    <cfif 0=("form.remember")>
    </cfif>

    <!-- OUTPUT -->
    <cfoutput>#Session.username#</cfoutput>
    <cfoutput>#Cookie.username#</cfoutput>
    <cfoutput>#Cookie.pass#</cfoutput>

    _Roudh Guest

  2. Similar Questions and Discussions

    1. Radio Buttons
      hi, can you let me know how to clear a radio button when the screen is loaded up again
    2. Flash MX 2004: Making radio buttons without using the radio buttoncomponent
      Hello Can anyway suggest a good guide for making radio buttons without the radio button component? I'm new to Flash, but I've gotten to the point...
    3. XML into radio buttons
      Hi, I am trying to attachMovie an XML file into a list radio buttons. Can anybody show me a clue on how to do that? Any comment, code, web site...
    4. Radio buttons help
      Try Using The Following: radioButtonName.setStyle("color", 0xFFFFFF); Replace The "FFFFFF" With The Hex Code For Whatever Colour You Want.
    5. Using Radio Buttons?
      Hi - how do I use radio buttons or check buttons so that only one of them at a time can be selected? I am using three but would like only one to...
  3. #2

    Default Re: Problems with radio buttons/cookies

    What's with that strange looking syntax <cfif 1=("form.remember")> anyway? I
    don't have CF around right now, so I can't test if it would actually work...
    CF uses "=" only when assigning something, not when comparing. Use IS or EQ.

    Would <cfif form.remember IS 1> work?

    Also, for shorter code, considering using <cfelseif> and <cfelse>, or
    <cfswitch> and <cfcase> (and <cfdefaultcase>, which is always needed).

    Fernis Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139