I am using ColdFusion to create a dynamic form based on the results of a database query. The form lists assets that are available to book on a project. Users then book as many of the assets as they want by selecting a start and end date for each asset from a popup calendar (each asset can have different start/end dates).
Upon clicking the Submit button I need to validate each pair of dates for the following:
1. Ensure that both a start and end date were entered for each asset (it's OK if both start/end are blank, just not one or the other)
2. Ensure that the end date of the pair is not earlier than the start date.
I don't have hard-coded field names because I don't know the size of the query. Therefore each start date field is named
and each end date field is named
(where #q_listing.identifier_id# is the ID of the asset). On my processing page I parse apart the field name to determine the ID and whether or not it's a start or end field.
I'm just not sure how to get the dynamic field names into JS validation so that it compares the correct pair values.
Any ideas? Thanks a bunch in advance!!
xsw1971
PS - the Tek-Tips search engine is down, so I was unable to determine if a post like this already exists.
Upon clicking the Submit button I need to validate each pair of dates for the following:
1. Ensure that both a start and end date were entered for each asset (it's OK if both start/end are blank, just not one or the other)
2. Ensure that the end date of the pair is not earlier than the start date.
I don't have hard-coded field names because I don't know the size of the query. Therefore each start date field is named
Code:
#q_listing.identifier_id#_start
Code:
#q_listing.identifier_id#_end
I'm just not sure how to get the dynamic field names into JS validation so that it compares the correct pair values.
Any ideas? Thanks a bunch in advance!!
xsw1971
PS - the Tek-Tips search engine is down, so I was unable to determine if a post like this already exists.