JQuery: Validating Data Rules

luke78

New Member
Site.This code is not optimized nor is it the best method. If you have any ideas to improve anything, let me know.Please visit the site to get an idea of the data.I have used Dan G. Switzer, II's calculation plugin [adding .sum() .max() .min() .avg()]The validation requirement i'd like to have is to make sure nothing conflicts with that user's already determined range. Also, that there are no gaps in the range.For example give\[code\]Brian 40 50 1200Brian 50 70 1200\[/code\]I dont want to the user to be able to set the first 50 to 39 because 39 would be smaller than 40. I dont want them to let 50 be set to anything higher than 50 because it would overlap the next range.Any good ideas? perhaps actually running through all the values and then making a real range and then on BLur have it check to make sure no range is actually overlapped or gapped.Each unique input is defined as id=NAME, so if I wanted to reference all the inputs of Brian, I could use \[code\]$("input[id='Brian']").each()\[/code\] or if I wanted to reference all the START inputs of Brian, I can use \[code\]$("input[id='Brian'][name='start[]'").each()\[/code\]Edit:One thing to note is that the page is PHP, and PHP is ran to populate the inputs via a CSV file. It will always start with correct data, and PHP can be used to help create ranges.because of this I was thinking of just disabling the START field, because it will always populate the next range. However, I will be adding the ability to delete rules, so that can get messy if they are limited in what they can do.
 
Back
Top