_required does not work - MX 7.0.0.91690 & W2003

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

  1. #1

    Default _required does not work - MX 7.0.0.91690 & W2003

    Simple code which exhibits the issue:

    <!--- Filename: b.cfm --->
    <FORM ACTION="b.cfm" METHOD="POST">
    <UL>
    <LI><INPUT TYPE="RADIO" NAME="CoreValueOverallRating" VALUE="3"></LI>
    <LI><INPUT TYPE="RADIO" NAME="CoreValueOverallRating" VALUE="2"></LI>
    <LI><INPUT TYPE="RADIO" NAME="CoreValueOverallRating" VALUE="1"></LI>
    <LI><INPUT TYPE="RADIO" NAME="CoreValueOverallRating" VALUE="0"></LI>
    </UL>
    <INPUT TYPE="HIDDEN" NAME="CoreValueOverallRating_required" VALUE="You did not
    rate the Overall Company Values">
    <INPUT TYPE="HIDDEN" NAME="CoreValueOverallRating_integer" VALUE="You did not
    rate the Overall Company Values">
    <INPUT TYPE="SUBMIT" VALUE="blah">
    </FORM>

    When I submit the page without selecting any of the radio buttons, CF does not
    complain. Turning on debugging, it shows:

    Debugging Information ColdFusion Server Standard 7,0,0,91690
    Template /b.cfm
    Time Stamp 28-Jun-05 10:50 AM
    Locale English (US)
    User Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
    Remote IP 172.16.3.152
    Host Name 172.16.3.152

    [...Non-relevent portions trimmed...]

    Form Fields:
    COREVALUEOVERALLRATING_INTEGER=You did not rate the Overall Company Values
    COREVALUEOVERALLRATING_REQUIRED=You did not rate the Overall Company Values

    Which clearly shows that the server did receive the
    COREVALUEOVERALLRATING_REQUIRED form field, didn't receive a
    COREVALUEOVERALLRATING field, and yet did not throw an error. Can anyone
    reproduce for a bug report?

    mathandmetal Guest

  2. Similar Questions and Discussions

    1. _required hidden input fields don't trigger validationin CFMX7
      On our new install of CFMX7 I've noticed that form validation is not being enforced when we've used _required hidden input fields. I even went...
    2. W2003 Terminal Server Issue
      Hi, Im running Windows 2003 Server whit Terminal Services in Remote Administration Mode. Since a few days when I'try to connect with Remote...
    3. W2003 Server Recovery Strategies
      Windows Server 2003 ================ I am really in need of some insight from others regarding their server recovery strategies. Buying the...
    4. would this work on W2003 Enterprise
      would this also work on a W2003 Ent box? http://www.firewallleaktester.com/wwdc.htm the executable does run, direct link is...
    5. W2003,WXP connection
      When I have the network computers(all running Windows XP professional)10 hours connected to a Windows 2003 server, the shared forlders in the...
  3. #2

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    The only time the _required and _integer come into play is if an appropriately
    named
    form field exists to check. Since the form field CoreValueOverallRating
    doesn't exist, there
    is no validation. CoreValueOverallRating_required, and
    CoreValueOverallRating_integer
    just become ordinary hidden form fields.

    OldCFer Guest

  4. #3

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    Larry,

    Ok, I'm confused, then. In previous versions of Cold Fusion, I've always used
    _required in form fields to be able to provide folks with a somewhat
    user-friendly error message if they didn't fill out all required form fields.
    On a Cold Fusion 5.0 server, the same code I posted results in:

    Form Entries Incomplete or Invalid
    One or more problems exist with the data you have entered.
    You did not rate the Overall Company Values

    Use the Back button on your web browser to return to the previous page and
    correct the listed problems.

    when I submit the form without selecting any of the radio buttons. And if you
    look at
    [url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/[/url]
    wwhelp.htm?context=ColdFusion_Documentation&file=0 0001385.htm and search for
    "_required, _cfformrequired", it says that this means "Data must be entered or
    selected in the form field." (emphasis mine)

    Since non-selected form fields end are not defined when submitted by (most,
    all?) browsers, _required firing for non-existent form fields, as well as blank
    but existing fields, seems to be the intent of this feature. And this is
    exactly how this worked in both 5.0 and 4.0. (I started programming with CF in
    '97). It is only now that we've finally upgraded to MX 7.0 that this isn't
    working.

    [1] I did try the code I posted using _cfformrequired instead of _required;
    that resulted in the same behaviour.

    mathandmetal Guest

  5. #4

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    The "selected" could apply to dropdown boxes, so I don't know that means much.
    As far as I know
    there is nothing to stop you from appending _required to any form field, in
    which case it is treated
    like any other field, if a matching name is not in the submitted form to
    validate against. All of the
    examples in the docs are with text fields. I don't remember ever trying this
    with radio buttons in
    earlier versions. I've always used Isdefined() in those situations.

    OldCFer Guest

  6. #5

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    Hmm. Well, that's a point I suppose. But since both 4.0 & 5.0 followed the
    logic that _required meant the rule would fire if the variable either did not
    exist or was empty, to my mind since I don't see this behaviour change
    documented anywhere in the MX documentation, this is a bug and I'll report it
    to them as such.

    Of course, I expect them to ignore me, or at best to "fix" the bug by
    post-documenting the behaviour change. Either way, I have a lot of code to
    add, now, to deal with this. (This is the 2nd change of a feature removed
    that's I'm not pleased with, but at least the other is actually documented.)

    mathandmetal Guest

  7. #6

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    Actually, I went back and tried it on CFMX 6.1, and it behaves like you said it
    does on 5.0, so it changed between CFMX versions.
    OldCFer Guest

  8. #7

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    Thanks for checking that; seems an even better reason to label it as a bug. I
    was just thinking if there was anything somewhat elegant I can do to deal with
    this immediately. I was thinking about writing a module that checks for all
    the _required fields submitted, but it seems the form.fieldnames variable that
    CF produces specifically excludes those items :(

    mathandmetal Guest

  9. #8

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    Did you file a bug on this? Have you contacted MM? We have run into this problem as well.
    Mike Greider Guest

  10. #9

    Default Re: _required does not work - MX 7.0.0.91690 & W2003

    Yes, I have filed this as a bug report via the web. I gave a brief description
    and refered them to this thread for more details. We don't have a support
    contract, just a software upgrade contract, and so I can't call support
    directly about it. Of course, I'd imagine they are more likely to put some
    priority into this as more people report this.

    FYI, although the descriptions of fixes do not mention this issue, I did apply
    the cumulative hot fix 2 earlier today to be certain it did not fix this issue.
    It does not.

    mathandmetal 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