Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default radio button

    i have 2 radio button and i want to set the 1st one is defaul <CFSET typeA =
    'exempt'> <INPUT type='radio' name='typeA' value ='exempt'
    <cfif typeA eq 'exempt'>checked</cfif>> <INPUT type='radio'
    name='typeA' value ='non_exempt' <cfif typeA eq '
    non_exempt'>checked</cfif> WHY my exempt button is not checked as
    default button ..??? i got 2 unchecked radio button PLEASE HELP!!!!! THANKS A
    BUNCH

    torm Guest

  2. Similar Questions and Discussions

    1. Taking a value from a radio button
      Hi, I?m trying to take a value from a radio button. But I?m don?t getting. I tried with a code, like that: ... var frm = document.forms;...
    2. Radio button insert
      Hello, I have the following code in my project: <cfinput type="radio" name="gender" value="Female" checked="yes"> Female <cfinput type="radio"...
    3. Radio Button Validation
      :o Hello, I am using CFForm and CFInput to construct a rather simple form. However, the javascript that I am using in the onvalidate event of one of...
    4. Radio Button Help me please!
      Hi I need help quick! let me explain my problem: Ičve made a form in flash with textfields and radio buttons. It submits the data from the...
    5. Radio button group
      I have a simple html page with a radio button group on it. I am submitting that page into an asp page. How do I know what button the user has...
  3. #2

    Default Re: radio button

    What HTML is being generated?

    When you're checking <cfif typeA eq " non_exempt">, where are you setting
    "typeA" equal to "non_exempt"?

    Also, while it's more typing, it's sometimes easier to just write out all your
    code, rather then set conditionals inside HTML tags. Sometimes it helps when
    debugging.



    <CFSET typeA = "exempt">

    <cfif variables.typeA EQ "exempt">
    <INPUT type="radio" name="typeA" value ="exempt" checked> Exempt
    <INPUT type="radio" name="typeA" value ="non_exempt"> Non-exempt
    </cfif>
    <cfif variables.typeA EQ "non_exempt">
    <INPUT type="radio" name="typeA" value ="exempt"> Exempt
    <INPUT type="radio" name="typeA" value ="non_exempt" checked> Non-exempt
    </cfif>

    cf_menace Guest

  4. #3

    Default radio button

    How do I keep the value for radio button when the page is refreshed? Another work, when the page is refreshed, I lost the value that I already select for the radio button

    Thanks
    kt03 Guest

  5. #4

    Default Re: radio button

    you can't do that. unless you create a form that submits to itself (its action page is itself) and using conditional logic you convert the form variables to session variables.
    champion_fella Guest

  6. #5

    Default Re: radio button

    would you give me some example?

    Thanks
    kt03 Guest

  7. #6

    Default Re: radio button

    could you describe in more detail a bit more about what you are trying to achieve
    champion_fella Guest

  8. #7

    Default radio button

    Hi,

    I have defined rabiobutton like this.

    <mx:RadioButtonGroup id="loption" />
    <mx:RadioButton groupName="loption" data="red" />
    <mx:RadioButton groupName="loption" data="green" />

    I want this field to be optional. If user does not select anyhting then I
    want to perform some function. How do I give that in if statement.
    I tried using if(loption.selected == false) It gives me an error. What
    condition I have to give.

    Thanks

    trycold Guest

  9. #8

    Default Re: radio button

    Have you tried:
    loption.selectedData == undefined

    Tracy
    ntsiii Guest

  10. #9

    Default Re: radio button

    hth




    <?xml version="1.0"?>
    <!-- Simple example to demonstrate the TextArea control -->
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
    backgroundColor="#FFFFFF">

    <mx:Script>
    <![CDATA[

    function checkValues()
    {
    var lblText:String;
    switch(loption.selection.data) {
    case "red": lblText = "Red";
    break;
    case "green": lblText = "Green";
    break;
    }
    if (lblText == "" || lblText == Null) lblText = "White";
    lblStatus.text = lblText;
    }

    ]]>
    </mx:Script>

    <mx:RadioButtonGroup id="loption" />
    <mx:RadioButton groupName="loption" data="red" />
    <mx:RadioButton groupName="loption" data="green" />
    <mx:Button label="Check Values" click="checkValues();"/>
    <mx:Label id="lblStatus"/>
    </mx:Application>

    mm_patrick Guest

  11. #10

    Default Re: radio button

    Hi,

    loption.selectedData == undefined
    worked in the if statement. But if I want to clear the setting like if some
    option is selected I want to unselect it then for the radiobutton I tried
    loption.selectedData = undefined. This didn't work. How do I do that.
    Basically I want to do this that once user has added the record I want to come
    back to the original settings where the radio button was not selected.

    Thanks

    trycold Guest

  12. #11

    Default radio button

    Hi,

    I have a form in which I have radiobutton. I ahve provided a clear button
    which clears everything in the form. When that button is pressed I want the
    radio button to be unseleced also. How can I deselect a radiobutton?

    Thanks

    trycold Guest

  13. #12

    Default Re: radio button

    I hope this helps





    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">

    <mx:Script>
    <![CDATA[
    function clearForm()
    {
    myGroup.selection.selected = false;

    }
    ]]>
    </mx:Script>

    <mx:Form>
    <mx:RadioButtonGroup id="myGroup"/>
    <mx:RadioButton id="rbutton1" groupName="myGroup"/>
    <mx:RadioButton id="rbutton2" groupName="myGroup"/>
    <mx:RadioButton id="rbutton3" groupName="myGroup"/>
    <mx:Button click="clearForm();"/>
    </mx:Form>
    </mx:Application>

    mm_patrick Guest

  14. #13

    Default Re: radio button

    Thanks
    trycold Guest

  15. #14

    Default Radio Button

    I am having all kinds of problems trying to return the string of the selected
    radio button to my VO. I have a set of radio buttons below. What I am trying
    to figure out is how I am supposed to return the selected value to my
    ProductVO.

    [Bindable] public var currentProduct:ProductVO = new
    ProductVO('',null,'','','upcRadio', 'prodNameRadio', 'epaRadio','');

    <mx:RadioButtonGroup id="searchtype"
    change="model.currentCaseVO.upcRadio" />
    <mx:RadioButton groupName="searchtype"
    id="upcRadio" value="upcRadio"
    change="model.currentCaseVO.upcRadio"
    label="UPC"
    width="116"/>
    <mx:RadioButton groupName="searchtype"
    id="prodNameRadio" value="prodNameRadio"
    change="currentProduct.prodNameRadio"
    label="Product Name"
    width="121"/>
    <mx:RadioButton groupName="searchtype"
    id="epaRadio" value="epaRadio"
    change="model.currentCaseVO.epaRadio"
    label="EPA/FDA"
    width="125"/>

    nrutter 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