**Please note I'm doing this off the top of my head. I don't have an editor
handy.

Well say you set up your select value to be a list with a pipe delim. Say
you have a course with min 4 and max 10 hours.
<option value="4|10">Super Awesome Course #1</option>

In your onChange you set a function call:
onChange(validateCourse(this.value))

then your javascript function

function validateCourse(objVal)
{

// set the course hours value to whatever the field name is.

var cHours = document.formname.courseHours.value;

var minMax = objVal.split("|");

if ((cHours >= minMax[0]) && (cHours <= minMax[1]))
{

// this is what you do when it meets your condition of min and max hours.

}
else
{

// this is what you do when it doens't meet your condition.

}

}




On Mon, Jun 14, 2010 at 9:27 AM, Dawn Sekel <dawnt...@yahoo.com> wrote:

>
> The purpose of my Form to provide a report completed training.  I am trying
> to validate that the Course Hours of the training is within a minimum and
> maximum range of hours.  I have a select field for Select_Course.  When the
> user selects the course name - I want to remember the minimum and maximum
> hours of the course and then do client side javascript validation that the
> hours entered in the Course Hours field is within the maximum and minimum
> values.  I know I've done something similar -- but can't remember how.
>  Thanks in advance for any advice.  My table for the select statement has
> the minimum and maximum hours in separate fields.
>
> Dawn
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334539
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to