Advertisement

04.02.2008 at 08:54AM PDT, ID: 23289764
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.5

JavaScript Form Validation, using inrange

Asked by leerljr68 in JavaScript, Miscellaneous Web Development, ColdFusion Application Server

Tags: ,

Here is the dilemma...I have a flash form field that I need to validate before the form is submitted...so I want to use JS so that when the user enters a date and moves to the next field the field validates to make sure it is NOT between a date range from a SQL table.

Basically there are blackout dates that are kept in a table and if the user enters a date that is inside any of the date ranges within this table, show an alert, so the user has to change the field before the form can be submitted.

The table looks like this:
intID   -   strReason   -   dtiStartDate   -   dtiEndDate
1        Memorial Day          05/19/2008          05/28/2008
2        Maintenance            06/02/2008          06/02/2008
3        Independence Day    07/01/2008         07/14/2008

So, if #dtiDateDesired# eq dtiStartDate or eq dtiEndDate or is between ('dtiStartDate' and 'dtiEndDate'), give me an alert box and it won't allow the form to be submitted until that date doesn't match anything that is in the table.

I'm just now starting to learn JS and I believe I need to use the inrange function but not really sure how to get it all put together.  Any assistance on this would be greatly appreciated as I bang my head on my desk.  Thanks!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
<!-- this is the code for the form -->
<cfform format="flash" 
         name="myform"
         action="/dev/test/include/success.cfm"
	method="POST"
	skin="haloOrange"
	width="950"
	height="1900"
	timeout="100"
	onsubmit="return checkform(this);">
 
<!-- this is the code for the input field -->
<cfinput name="dtiDateDesired"
         label="Date Desired:"
	type="datefield"
	width="160"
	align="left"
	value="#dateformat(now()+21, "mm/dd/yyyy")#" 
	validate="date">
 
<!-- this is the code for the submit button -->
<cfinput type="submit"
	name="BtnSubmit"
	validate="submitonce">
[+][-]04.04.2008 at 02:50PM PDT, ID: 21285898

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, Miscellaneous Web Development, ColdFusion Application Server
Tags: Adobe, ColdFusion
Sign Up Now!
Solution Provided By: nschafer
Participating Experts: 1
Solution Grade: B
 
 
[+][-]04.10.2008 at 09:38AM PDT, ID: 21326707

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.01.2008 at 08:09AM PDT, ID: 21479329

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628