Ask a Question related to Macromedia ColdFusion, Design and Development.
-
mathandmetal #1
_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
-
_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... -
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... -
W2003 Server Recovery Strategies
Windows Server 2003 ================ I am really in need of some insight from others regarding their server recovery strategies. Buying the... -
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... -
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... -
OldCFer #2
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
-
mathandmetal #3
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
-
OldCFer #4
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
-
mathandmetal #5
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
-
OldCFer #6
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
-
mathandmetal #7
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
-
Mike Greider #8
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
-
mathandmetal #9
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



Reply With Quote

