Professional Web Applications Themes

Required radio cfinputs not working in CF 7 - Macromedia ColdFusion

Well, the radio dials are created on the fly, depending upon whether a user selected something else earlier on and it it's in the database. If it does appear with the correct value in the database, the following code is called: <b>#qSelectQuestion.question_string#</b> <br /> Is this required in 10 years?<br /> <cfif qSelectExtendedResponse.question4_response EQ 1> <cfinput type="radio" name="#question#" value="1" required="yes" message="Please select an answer Question 4" checked>&nbsp;Yes <cfinput type="radio" name="#question#" value="0" required="yes" message="Please select an answer Question 4">&nbsp;No <cfelseif qSelectExtendedResponse.question4_response EQ 0> <cfinput type="radio" name="#question#" value="1" required="yes" message="Please select an answer Question 4">&nbsp;Yes <cfinput type="radio" name="#question#" value="0" required="yes" message="Please select ...

  1. #1

    Default Required radio cfinputs not working in CF 7

    Well, the radio dials are created on the fly, depending upon whether a user
    selected something else earlier on and it it's in the database. If it does
    appear with the correct value in the database, the following code is called:

    <b>#qSelectQuestion.question_string#</b> <br />
    Is this required in 10 years?<br />
    <cfif qSelectExtendedResponse.question4_response EQ 1>
    <cfinput type="radio" name="#question#" value="1" required="yes"
    message="Please select an answer Question 4" checked>&nbsp;Yes
    <cfinput type="radio" name="#question#" value="0" required="yes"
    message="Please select an answer Question 4">&nbsp;No
    <cfelseif qSelectExtendedResponse.question4_response EQ 0>
    <cfinput type="radio" name="#question#" value="1" required="yes"
    message="Please select an answer Question 4">&nbsp;Yes
    <cfinput type="radio" name="#question#" value="0" required="yes"
    message="Please select an answer Question 4" checked>&nbsp;No
    <cfelse>
    <cfinput type="radio" name="#question#" value="1" required="yes"
    message="Please select an answer Question 4">&nbsp;Yes
    <cfinput type="radio" name="#question#" value="0" required="yes"
    message="Please select an answer Question 4">&nbsp;No
    </cfif>

    The problem is in ColdFusion 7 that these Required fields do not work. For
    some reason they worked when I had CF 6.1 installed on my local host machine,
    but the server I use to host my site uses CF 7, so when I upgraded these
    Required fields stopped working. Also, because it's created on the fly, I'm not
    sure if or how there is a way to double check this in Javascript. Any ideas why
    it doesn't work, at least not in CF 7??

    Thanks,
    Ken

    kneijst1 Guest

  2. #2

    Default Re: Required radio cfinputs not working in CF 7

    I am sorry I can't help more, but all I can say is that CF7 seems to have managed to break lots of the CFINPUT functionality. Things that worked fine in CF6.1 are completely broken now.
    fraumeni Guest

  3. #3

    Default Re: Required radio cfinputs not working in CF 7

    Have you looked at the javascript includes to make sure the path is correct?
    What does it do or not do that you were expecting?

    <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>


    BSterner Guest

  4. #4

    Default Re: Required radio cfinputs not working in CF 7

    Sorry, no solution that I know about. I left a comment at livedocs in Aug.
    http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001385.htm
    and also filed a bug report...but haven't heard a thing...maybe it will
    be fixed in the next updater.


    --
    Tim Carley
    www.recfusion.com
    com
    Mountain Guest

  5. #5

    Default Re: Required radio cfinputs not working in CF 7

    thanks for the replies so far guys.

    I do have these in it:

    <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
    <script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>

    but no luck. I one of the radio dials is not checked, it's supposed to display
    the message, but it doesn't. I don't get any errors either.

    kneijst1 Guest

  6. #6

    Default Re: Required radio cfinputs not working in CF 7

    Post the code for the page after it's been serverd up by CF.

    If you're using "cfinput", you should be using "cfform" and, sorry, look for
    the javascript includes on the actual page that's rendered by CF to the user.
    cfform should include these when parsing the page.


    BSterner Guest

  7. #7

    Default Re: Required radio cfinputs not working in CF 7

    Kneijst1,

    I don't see any problem. The summary of your code is:

    <cfif qSelectExtendedResponse.question4_response EQ 1>
    <cfinput type="radio" name="#question#" ... checked>
    <cfinput type="radio" name="#question#" >
    <cfelseif qSelectExtendedResponse.question4_response EQ 0>
    <cfinput type="radio" name="#question#" ...>
    <cfinput type="radio" name="#question#" ... checked>
    <cfelse>
    <cfinput type="radio" name="#question#"...>
    <cfinput type="radio" name="#question#"...>
    </cfif>

    Where you use the attribute "checked", a selection has been made. In those
    cases,
    the "required" attribute in unnecessary. So, it makes sense to check whether
    the "required"
    attribute works only in the case where
    qSelectExtendedResponse.question4_response
    is not 0 or 1.

    BKBK Guest

  8. #8

    Default Re: Required radio cfinputs not working in CF 7

    Hi guys -

    This is all wrapped in this cfform:

    <cfform name="extend" method="post" action="#CGI.SCRIPT_NAME#"
    onsubmit="return disallowBlank()">

    Also, it's the last part of the code that doesn't work. The "cfelse" gets
    called, since there is nothing in the database for new users on the page, and
    nothing is checked when they load the page. I should/could take out the
    'required' and the 'message' parts in the first two sections of the cfif
    statement.

    I do have a feeling Mountain Lover is right, that Macromedia needs to fix this
    in CF 7.0, since it does work correctly in CF 6.1.

    kneijst1 Guest

  9. #9

    Default Re: Required radio cfinputs not working in CF 7

    Kneijst1 and Mountain Lover may indeed be on to something here.
    Even when the built-in scripts, cfform.js and masks.js, are loaded,
    and the form contains only unchecked Radio and Checkbox fields,
    CF apparent fails to generate the required Javascript.

    I suupose one has to re-examine the code for /CFIDE/scripts/cfform.js,
    starting with the code block

    else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
    {...}


    BKBK Guest

Similar Threads

  1. Radio Help
    By Mirle in forum Macromedia Flash Player
    Replies: 0
    Last Post: March 16th, 04:40 PM
  2. debug not showing & required fields not working
    By mcisi in forum Coldfusion Server Administration
    Replies: 0
    Last Post: November 30th, 03:02 PM
  3. Arrays inside cfinputs?
    By jas5on in forum Macromedia ColdFusion
    Replies: 1
    Last Post: May 5th, 11:58 AM
  4. Replies: 6
    Last Post: May 3rd, 08:27 PM
  5. Replies: 2
    Last Post: June 23rd, 04:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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