scripter73
Programmer
Hi,
I REALLY hope this isn't information overload. I'll try to explain this
as clearly as I can.
I have a form that has the following info:
1) text fields to represent date parts
2) checkboxes that represent reports a user can view upon selecting; the report data
will be based on the date range the user provides
<form name="homedate" action="date.cfm" method="post"
onSubmit="return CountChecks(this.form);return verify(this);>
<input type="text" name="startmonth" maxlength=2 size=3>
<input type="text" name="startday" maxlength=2 size=3>
<input type="text" name="startyear" maxlength=4 size=5>
<input type="text" name="endmonth" maxlength=2 size=3>
<input type="text" name="endday" maxlength=2 size=3>
<input type="text" name="endyear" maxlength=4 size=5>
<input type="submit" name="Submit" value="Submit">
</form>
When the user Submits this form, the action page is another page that processes
my form data to retrieve the reports. Also, when the user submits the forms,
I have a function called CountChecks() that simply limits the user to
one day's worth of data when more than one checkbox is selected. (This info is
irrelevant to my problem.) Likewise, I have a Javascript validation function
verify() (Also irrelevant to my problem.)
GOAL: Cold Fusion needs the form variables from its own page to
perform some data manipulations such as when the dates the user entered are past
a certain date, etc.
At first, I tried to create a JS function and pass a CF variable to that function, but
couldn't update the CF variable.
Now, what I'm trying to do is submit the form to itself and pass the form fields
through the URL so that CF can access the url variables. I don't want to have to
leave this page to go to another page.
Here's what I have so far:
<script language="Javascript">
<!--
function SubmitForm(){
document.homedate.action="homepage.cfm"; (homepage.cfm is name of page)
document.homedate.method="get";
document.homedate.submit();
}
// -->
</script>
<form name="homedate" action="date.cfm" method="post"
onSubmit="SubmitForm();return CountChecks(this.form);return verify(this);>
..... INPUT FIELDS FROM ABOVE I reset the text fields
to the url values......
</form>
I really don't have a problem, but my goal is to use the form variables in my Cold Fusion
to do a DateDiff on the form fields and popup a message to the user if the dates
are more than 120 days from today's date.
I'm not sure where to stick that date check logic in relation to my current code before
I return the form to the user.
I realize this is a really long post, but any help you can provide would be GREATLY
appreciated.
Thanks in advance,
scripter73
Change Your Thinking, Change Your Life.
I REALLY hope this isn't information overload. I'll try to explain this
as clearly as I can.
I have a form that has the following info:
1) text fields to represent date parts
2) checkboxes that represent reports a user can view upon selecting; the report data
will be based on the date range the user provides
<form name="homedate" action="date.cfm" method="post"
onSubmit="return CountChecks(this.form);return verify(this);>
<input type="text" name="startmonth" maxlength=2 size=3>
<input type="text" name="startday" maxlength=2 size=3>
<input type="text" name="startyear" maxlength=4 size=5>
<input type="text" name="endmonth" maxlength=2 size=3>
<input type="text" name="endday" maxlength=2 size=3>
<input type="text" name="endyear" maxlength=4 size=5>
<input type="submit" name="Submit" value="Submit">
</form>
When the user Submits this form, the action page is another page that processes
my form data to retrieve the reports. Also, when the user submits the forms,
I have a function called CountChecks() that simply limits the user to
one day's worth of data when more than one checkbox is selected. (This info is
irrelevant to my problem.) Likewise, I have a Javascript validation function
verify() (Also irrelevant to my problem.)
GOAL: Cold Fusion needs the form variables from its own page to
perform some data manipulations such as when the dates the user entered are past
a certain date, etc.
At first, I tried to create a JS function and pass a CF variable to that function, but
couldn't update the CF variable.
Now, what I'm trying to do is submit the form to itself and pass the form fields
through the URL so that CF can access the url variables. I don't want to have to
leave this page to go to another page.
Here's what I have so far:
<script language="Javascript">
<!--
function SubmitForm(){
document.homedate.action="homepage.cfm"; (homepage.cfm is name of page)
document.homedate.method="get";
document.homedate.submit();
}
// -->
</script>
<form name="homedate" action="date.cfm" method="post"
onSubmit="SubmitForm();return CountChecks(this.form);return verify(this);>
..... INPUT FIELDS FROM ABOVE I reset the text fields
to the url values......
</form>
I really don't have a problem, but my goal is to use the form variables in my Cold Fusion
to do a DateDiff on the form fields and popup a message to the user if the dates
are more than 120 days from today's date.
I'm not sure where to stick that date check logic in relation to my current code before
I return the form to the user.
I realize this is a really long post, but any help you can provide would be GREATLY
appreciated.
Thanks in advance,
scripter73
Change Your Thinking, Change Your Life.