Using CFIF in CFINPUT radio tag

I'm a little new to using cfinput. I always use HTML input.
I have radio buttons for gender. When the form is submitted,
the value is entered into a db column 1 or 2:
<cfinput name="g" id="g" type="radio" value="1"
required="yes" />  F<cfinput name="g"
id="g" type="radio" value="2" />
I want to check one by default depending on the value stored
in the db column when the form loads.
I'm able to use a CFIF statement to check one by default in
the HTML radio like:
<cfif rs.g eq 1>checked="true"</cfif>
but you're not allowed to have cfif in a single cfinput tag.
How do I do it.

Hi lovewebdev,
If I understand correctly what it is your trying to accomplish, try something like this.
<cfif rs.g eq 1>
<cfinput type="radio" checked="yes">F <cfinput type="radio" checked="no">M
<cfelseif rs.g eq 2>
<cfinput type="radio" checked="no">F <cfinput type="radio" checked="yes">M
</cfif>
So based on the value of the db column, the correct form elements will display
and the right one should be checked.
Leonard B

Similar Messages

  • My form has a list of yes or no questions.  I want to use either cheboxes or radio buttons.  I can't make it work.  When I check yes for one question, it marks all yes answers for all other questions.  If I mark some radio buttons to answer, it unmarks la

    My form has a list of yes or no questions.  I want to use either cheboxes or radio buttons.  Unfortunatly I can't make it work.  When I check yes for one question, it marks all yes answers for all other questions.  If I mark some radio buttons to answer, it unmarks later.  Need immediate help!!!

    Is it that you are using a PDF-based form? Did you copy and paste the Yes/No fields all the way down your form? If so, then all of the yes/no boxes are copies of each other and have the same name and properties in the PDF.
    For example, if you had:
         Question 1 and Question 1 Yes/No checkboxes
         Question 2 and Question 1 Yes/No checkboxes
         Question 3 and Question 1 Yes/No checkboxes
         Question 4 and Question 1 Yes/No checkboxes
    Then whatever answer you selected in Question 1 would populate down through the rest of the form.
    Changing the Yes/No field properties in questions two through four would eliminate the problem.
    I hope that helps,
    Brian

  • Dynamic text box generation in jsp page by using net-ui jsp html tags

    Hi All,
    I Need to generate the "TextBoxes" Dynamically by using the "Net-UI HTML Tags".How can i do this ?
    I am using
    1. WebLogic portal server 8.1 sp4 (Workshop dev environment)
    2. JavaPageFlow Applications
    3. Net-UI tags html jsp
    I need to generate the textboxes dynamically and i have to
    get those values in the page flow .
    How it is possible by using the "Net-UI Tags".
    Thanks In Advance,
    KiranBabu.Karusala

    how we create dynemic text box in jsp based one value which we give at runtime

  • Using Graphic Equaliser For Radio to Reduce Hiss?

    Using Graphic Equaliser For Radio to Reduce Hiss?
    I would like to use the graphic equaliser to reduce hiss while using the radio. Does anyone know if this is possible and how to do it?
    Kind Regards
    Chris

    You can adjust adjust the individual low pass filters to minimise the effect of hiss, and although this will mitigate the problem somewhat and make it less intrusive, it won't stop it altogether.

  • What is the Use of Text Module Radio buton in Smartforms

    Hi all,
    What is the Use of Text Module Radio buton in Smartforms T - code ? How can we link this to our form ?
    Thanks in advance
    KR

    Text modules
    Text modules are used to centrally store texts that are used frequently in forms in the system.
    Text modules are included in forms using texts nodes. The text node can either refer to the text module or take its text. You can then change the text or add to it to suit the form.
    Text modules have the following attributes:
    They are client-independent
    They are connected to the transport system
    They are connected to the translation tools in the system
    The third attribute means that a text module can be uniquely assigned to a language using the logon language. When including a text module, you can also access translations of the text module, for example, to include an English text module in a German form.
    Reward Points if useful.

  • How to dynamically include jsp files using jsf el in include tag ?

    Hi,
    I'm trying to get the jsp file name from my backing bean to use it in an include tag but I can't make it work
    When using this piece of code I can get the generated path
             <h:outputText value="/_partial/#{myBean.jspName}.jsp"/>whereas in this code the jsf el is not replaced by this value.
            <%@ include file="/_partial/#{myBean.jspName}.jsp" %> Have you any idea of how to solve this ? I'm currently developing for J2EE 1.4 platform.     
    Thanks for your help,
    Regards.

    If you're using JSF 1.2 and JSTL 1.2 at a JSP 2.1 environment, then you can just use <jsp:include> with unified EL.
    If you're using JSF 1.1, then you may find this article useful [http://balusc.blogspot.com/2007/01/dynamic-jsf-subviews.html]

  • How to use Euro symbol in xml tags?

    How to use Euro symbol in xml tags?

    What do you mean by "in xml tags"? Can you post a three-line XML snippet showing what you hope to achieve?

  • Use iTunes for internet radio - settings question

    Hi all,
    I have a Linn Klimax DS (digital streaming) unit as part of an audio system, and that's being fed over my Cat5 network by a Twonky MediaServer installed on one of my mac's. That Twonky setup has SHOUTcast enabled and was serving internet radio fine and identified the stations until I installed iTunes 8 yesterday. I made the mistake of clicking on the button that says 'Use iTunes for Internet radio' in the preferences-> advanced->general pane.
    Basically, I need to find out what precisely that setting actually does under the hood, so I can use the command line to reset that, turn it off, or undo basically what it did set.
    Hope someone can shed a bit of light on that, maybe even just a hint, as I have been through the console logs, but haven't seen anything that jumps out at me. Thanks in advance for any help.
    Chris

    It's in Preferences>Advanced>General.
    Hope this helps.
    M

  • Using cfif v/s CASE WHEN

    Hi everyone,
    I'm currently working on optimizing a report that takes about
    2 minutes to load. The main reason is that it has sooo much data. I
    noticed 2 things that i might be able to improve on...first there
    are a ton of <cfif> statements and second there are so many
    Query of Queries for each record. Basically I need help with these
    2 things:
    1) There are quite a few boolean fields. Currently the logic
    is on the .cfm page meaning for a certain boolean field, we use
    <cfif qryGetPipelines.pipebdw_is_me_tech_assistance eq
    1>
    Y
    <cfelse>
    N
    </cfif>
    My question is that would it better and more efficient if i
    just use a CASE WHEN pipebdw_is_me_tech_assistance = 1
    THEN....statement in the query and that way i don't have to do the
    <cfif> on the .cfm page?
    2) My second question is: let's say the report pulls up 400
    records, i then loop through those records and display the
    different fields and i also perform about 10 Query of Queries in
    each loop to get fields that have more then 1 record. So bascially,
    for each of the 400 records, i have 10 additional Query of Queries
    and though it's only about 15 - 20 ms per query...when you add
    multiply 10 * 400 it takes up quite a lot of time. Is there any
    other way around this??
    Thank you so much for all your help.
    Anju

    @Ian - Thanks for your help Ian and the answer to your
    question is yes i do plan to put the CASE statement in the Sql
    query, currently the logic is being done by using <cfif> on
    the .cfm page.
    @Dan - Thanks for your help as well. Can you please give me a
    little more info as to what would be a more effiicient way then
    looping through a query in order for me to display about 30 columns
    (fields) of data for anywhere from 400 - 1000 records?
    Thanks again for all your help

  • How to Use Spry to Validate Radio button

    How to use Spry Validation for radio button?
    The samples only have checkbox, text, select and textarea.
    Thanks

    I needed to add radio buttons to the live (non-destructive)
    filter so users could choose which column they wanted to search
    data from. Its been modified from the "contains CB" but works
    nicely. It also had to rebuild table when another button was
    selected. I'll post some code if anyone would like to use it....
    The Form area -
    <form name="filterform">
    Data Filter: <input type="text" id="filterTF"
    onkeyup="StartFilterTimer();" />
    <input type="radio" id="containsCB" name="radio"
    value="module" onclick="resetfilter();" checked /> by Module
    <input type="radio" id="containsCB" name="radio"
    value="oper" onclick="resetfilter();" /> by Oper
    <input type="radio" id="containsCB" name="radio"
    value="phone" onclick="resetfilter();" /> by Phone
    <div id="radiovalue"></div>
    </form>
    The JS area -
    function FilterData()
    var tf = document.getElementById("filterTF");
    for (var c=0; c < document.filterform.length; c++)
    if (document.filterform[c].checked)
    var choice = document.filterform[c].value;
    if (!tf.value)
    // If the text field is empty, remove any filter
    // that is set on the data set.
    dsRows.filter(null);
    return;
    // Set a filter on the data set that matches any row
    // that begins with the string in the text field.
    var regExpStr = tf.value;
    regExpStr = "^" + regExpStr;
    var regExp = new RegExp(regExpStr, "i");
    var filterFunc = function(ds, row, rowNumber)
    var str = row[choice];
    if (str && str.search(regExp) != -1)
    return row;
    return null;
    dsRows.filter(filterFunc);
    function StartFilterTimer()
    if (StartFilterTimer.timerID)
    clearTimeout(StartFilterTimer.timerID);
    StartFilterTimer.timerID = setTimeout(function() {
    StartFilterTimer.timerID = null; FilterData(); }, 400);
    function resetfilter() {
    // var tf = document.getElementById("filterTF");
    // var tfval = tf.value;
    document.getElementById("filterTF").value = "";
    StartFilterTimer();

  • Why would someone use the meta utf-8 tag inside the script tag?

    I have run into a number of sites that use the <meta utf-8> tag inside the <script> tag what is the use of it.
    How dose one write the utf-8 inside the script tag?

    csteinola wrote:
    > If I CFINCLUDE that cache file, the characters come out
    munged (non-utf-8
    > encoded).
    try prepending a <cfprocessingdirective
    pageencoding="utf-8"> to the file.

  • ZEN X-Fi 2 does not read in numbers if used as Artist name's tag?

    Dear Creative labs,
    I have got an artist named 3 so when I import his CD into my ZEN X-Fi 2 the artist name tag is not recognized and it falls under Unknown Artist. When I change the tag into the spelling Tre (Italian for 3) the name is correctly imported.
    May I conclude that the firmware does not recognize number if used as Artist name's tag? is there any way to fix it's
    regards
    Pasquale

    Hi,
    I tried it myself and I get the same result. I changed the Artist's name of a random album to "3" and it got listed as "Unknown Artist" in the player.
    Surprizingly it did work when I changed it to "33". It got listed on top of the Artist list as it should.
    I guess this is a firmware bug. I'm using version .2.08 so I hope this will be added to the to-fix list for the next firmware update. (I know the newest version is .20.08 but that version only adds support for the 64GB model.)
    Nice catch Pasquale !

  • HD radio tagged items not showing up in iTunes

    Hello,
    I have just transitioned from an imac to a mac pro and have lost the "tagged" line.  Any idea how to get it back?
    the Store category in the itunes sidebar used to have three entries, now only two are visible.
    iTunes Store
    Purchased
    "Tagged" was the third line
    Any idea how to get this back?
    Thank you.

    Hi Hobz009,
    Thanks for visiting Apple Support Communities.
    If you are tagging songs from radio on an iPod nano, try this step:
    Transfer tagged song information to iTunes
    Connect your iPod to your computer and select your iPod.
    Click Sync.
    You can find this information here:
    iTunes 11 for Mac: Purchase tagged radio songs
    http://support.apple.com/kb/PH12298
    Best,
    Jeremy

  • Using cfif in input fields

    I know rest buttons are useless, but my customer wants one,
    so here I am. I have a form, and the text input and radio buttons
    have cfif statement to check for values. It all works well. But, by
    putting cfif in the input fields, the Reset button will not work.
    If I take the cfif statements out, the Reset button works fine.
    Just not with the cfif statements. Is there any way around this?
    My code is:
    <input type="radio" name="first_rate_calc" value="0"
    onfocus="CLEARFORM()" <cfif
    isDefined('form.first_rate_calc')><cfif form.first_rate_calc
    EQ 0>checked="true"</cfif></cfif> />
    and
    <input name="current_multiplier" type="text"
    id="current_multiplier" size="5" maxlength="5" <cfif
    isDefined('form.current_multiplier')><cfif
    form.current_multiplier NEQ "">Value=
    "<cfoutput>#form.current_multiplier#</cfoutput>"</cfif></cfif>
    />

    DaSpaz wrote:
    Define 'Does not work'?
    Other then some horable tag nesting going on there, I do not
    see any
    obvious reason why your code would not work with the 'reset'
    HTML control.
    Clicking on the reset button should return any changed values
    in the
    form to the original value when the form was first rendered
    by the
    client browser.

  • Cfform using cfif in action= causes error

    Hi,
    Just ran into a code problem I haven't seen before. To use
    the CF validation for some text input, I've changed some of our
    <form's to <cfforms> However, If I want to check for the
    existence of a URL param before trying to send it in the action= of
    the <cfform, CF screws up the evaluation of other variables. In
    the example below, the value of the URL variable Stoken becomes
    "12345<cfif isDefined ......" . This code works fine in a
    <form action=, but not in <cfform.
    I would like to keep the <cfif isDefined() in the code
    because the alternative is to edit a lot of other templates. Any
    suggestions why this isn't working?
    Thanks,
    Doug

    You can't nest tags like this:
    <cftag1 <cftag2>>
    Attaching url variables to a form action attribute is
    generally not done. I didn't even realize it would work. More
    conventional methods are to use session variables which don't need
    to be passed, or to use hidden form fields to pass url
    variables.

Maybe you are looking for

  • Lenovo G560 few issues

    Hello to all Archers! I have few issues with my lenovo g560. First of all, when browsing for example, the X suddenly freezes and dunno why... just freezes... The only thing that i can do is the force reboot... 2. i have a mute led button which shine

  • Strange behavior of StuffIt-Expander

    Hi there, having heard of the "new viri" for Mac OSX I turned over to MacFixIt and similar sites to check what's to do. The first advice I read was to "un-check" the "open 'safe' files automatically in Safari" option in the Safari preferences. So I d

  • Trying to determine the age of a 1242AG access point

    I have an AIR-LAP1242AG-A-K9, serial number FTX1623B0RX. I just need to know how old this unit is. Any idea how I find that info? (I haven't attached it to our Cisco account, so I can't open a TAC for it.) Thanks! Boot Version  12.4.13.0 IOS Version 

  • Is there a way to change the size of a menu background?

    I would like to use my own photo as a menu background and reduce it's size to less than the full size of the menu. The photo selection sticks over a save and re-open but the size of the object reverts to the full menu size when the project is reloade

  • Universal Binaries for FCE HD?

    will FCE HD be phased out? Or will apple introduce universal binaries for FCE HD? Or has it already been ported? If anyone knows for sure, please post revelant URLs (rather than opinions) thanks