Re: Form Help
- Original Message - From: Jillian Carroll [EMAIL PROTECTED] Can anybody please help me with this page? I've been fooling around with it forever and I'm just not having any luck. There are two things that I need help with: 1.Why aren't my dropdowns working properly? They should be pulling the data from the database and displaying it when possible. As it stands, they just look like regular drop-downs, no matter what value is in the db. This code has worked for me on other forms, but for some reason I must have done something different here. What's happening with the drop-downs? Not sure I understand from this. Is there no data returned by the queries that populate them? If there is data returned, is it not being output correctly in the drop-down? In what way is are the drop-downs not working? As you say you've been fooling around with them a lot, I assume you've done the usual routine of paring your code down in a test page to the bare minimum that's needed to causes the error, and carry on paring until the error doesn't appear... Not sure about multiple INSERTs, though I'm certain this is a topic that you'll find some coverage of in the list archives. I think as far as SQL syntax goes, it's one INSERT at a time. HTH, Gyrus [EMAIL PROTECTED] work: http://www.tengai.co.uk play: http://norlonto.net PGP key available ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: FORM help
In javascript (client side): if(!document.myform.mycheck.checked){ //write your validation for the mandatory fields here } In CF (server side): cfif NOT IsDefined(form.mycheck) !--- write your validation for the mandatory fields here --- /cfif Pascal -Original Message- From: Tilbrook, Peter [mailto:[EMAIL PROTECTED]] Sent: woensdag 17 juli 2002 9:02 To: CF-Talk Subject: FORM help I have a form where some of the fields are mandatory. However at the bottom is a check box to say the the form details are not required by the application. How can I test for the mandatory fields but ignore them if they select that the service is not required and submit the form? Thanks! :) __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: FORM help
Well it depends on if you want JS alerts, or if you prefer to send them to another page listing the errors with a back link. Douglas Brown Email: [EMAIL PROTECTED] - Original Message - From: Tilbrook, Peter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, July 17, 2002 12:02 AM Subject: FORM help I have a form where some of the fields are mandatory. However at the bottom is a check box to say the the form details are not required by the application. How can I test for the mandatory fields but ignore them if they select that the service is not required and submit the form? Thanks! :) __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: FORM help
You can use Javascript.. but using a template and passing variables back to the template for correct is a much more cleaner approach.. Cfif isDefined(form.CheckboxName) in CF If document.formname.CheckboxName.value == in JavaScript Joe Certified Advanced ColdFusion Developer [EMAIL PROTECTED] -Original Message- From: Tilbrook, Peter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 17, 2002 3:02 AM To: CF-Talk Subject: FORM help I have a form where some of the fields are mandatory. However at the bottom is a check box to say the the form details are not required by the application. How can I test for the mandatory fields but ignore them if they select that the service is not required and submit the form? Thanks! :) __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: FORM help
You can use Javascript.. but using a template and passing variables back to the template for correct is a much more cleaner approach.. Cfif isDefined(form.CheckboxName) in CF If document.formname.CheckboxName.value == in JavaScript erm... close, but not quite... document.formname.CheckboxName.checked == true; using Checkbox.value == will tell you whether or not you typed checkbox ... value= when you were constructing the form. Isaac Dealey www.turnkey.to 954-776-0046 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Form Help
How about just cfif Attributes.Json IS "on"/cfif (the "IS" test isn't a case-sensitive test). :-) I read a while back that compareNoCase is a faster way of comparing strings than using IS... Correct. Since CompareNoCase() is a boolean expression, it supposedly executes faster than a string expression like IS. From what I understand, this is true for all boolean vs. string comparisons. I do use CompareNoCase() over IS myself, but I have found that it's not the most "user-friendly" code and tends to confuse the heck out of the newer codings because you have to use a NOT modifier in order to test for a true boolean condition. So... CFIF NOT CompareNoCase(Attributes.Json, "on") ...may be faster, but... CFIF Attributes.Json IS "on" ...is the more intuative approach and doesn't confuse the heck out of people (also takes less time to type). It all depends on how your application needs to work I guess. If you have a lot of load, or you're looping over thousands of lines (see below) and need to cram every last millisecond of performance out of CF, the CompareNoCase() may be better, but if you need the app done yesterday, and there's the possibility of a newer coder working on it in the future, it may be worth the slight performance drop to use the IS comparison. Just as a reference, I tested the two methods on my Compaq 1850r server, which has a single PII-400 processor. The first code sample.. CFSET Variables.DS = "this" CFLOOP FROM="1" TO="5000" INDEX="key" CFIF Variables.DS IS "this" /CFIF /CFLOOP ..took an average of 1265 milliseconds to complete according to the debugging info. The second sample.. CFSET Variables.DS = "this" CFLOOP FROM="1" TO="5000" INDEX="key" CFIF NOT CompareNoCase(Variables.DS, "this") /CFIF /CFLOOP ..averaged 453 milliseconds. So, it would appear that using the boolean operator really IS faster, and that whatever it is that the previous poster mentioned was correct. -Justin Scott, Staff Developer http://www.annex.com PS: Sorry about the crosspost on CF-Talk. It was a good thread on the fusebox list and I thought it would benefit the "rookie" developers on the list since they probably never thought about this kind of stuff. I know I never did until about 8 months ago g. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists