Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use next/previous record browsing

Status
Not open for further replies.

edP123

Technical User
Nov 19, 2002
10
US
HI,
I've a problem to brows the next/previous link using option value format for the date.In my action page I'm using this function as follow:
<cfset startdate=#CreateDate('#form.startyear#','#form.startmonth#','#form.startday#')#>
<cfset enddate=#CreateDate('#form.endyear#','#form.endmonth#','#form.endday#')#>
<cfquery........>
select...where recdate >= #startdate#
and recdate <= #enddate#
</cfquery>

It can brows at the first page, but when I click on the next button it shows the error as follow:
An error occured while evaluating the expression
<cfset startdate=#CreateDate('#form.startyear#','#form.startmonth#','#form.startday#')#>

ANY SOLUTION....THANK YOU

 
the SQL syntax for that usually looks somewhat like this (depending on the database you are using):

WHERE recdate BETWEEN '#startdate#' AND '#enddate#' Sylvano
dsylvano@hotmail.com
 
hi,WWebspider

It doesn't works....Any solution?????
 
What error are you getting?

What database are you using?

Help us out here!
 
The syntax to set the startdate is correct -- most likely it is the value of the form.startyear, form.startmonth or form.startday that is not getting passed correctly. Make sure that is correct.

For example, if they select a month that only has 30 days like April, but select 31 for the day, then it will give you that error.
 
Hi, SimonA
Here's the error message:
An error occured while evaluating the expression
<cfset startdate=#CreateDate('#form.startyear#','#form.startmonth#','#form.startday#')#>

and I'm using Access 2000. Thank you
 
Hi, CFDude
I've a valid check for the Start and End Date for year, month and day at the form page using JAVA Script. Thank you.
 
Right before the cfset, do a cfoutput of the form.startyear, form.startmonth and form.startday and do a <cfabort> What values are getting passed?
 
Hi, CFDude
The value is:
Start Date('2001','6','1')

what I understand is that once I click on the NEXT link it don't have the value to pass on to the,

<cfset startdate=#CreateDate('#form.startyear#','#form.startmonth#','#form.startday#')#>

Thank you.
 
You have to pass on the startyear, startmonth, and startday to the page that uses the cfset every time. Form variables do not persist page to page, unless you post to each page every time, and put the values as hidden values. You could set the variables as a session variable and reference those.

Does the error you are getting say it has trouble evaluting the expression FORM.STARTYEAR or something like that?

That would be the problem -- it is not getting the variables it needs. How are you linking the start/next pages together? You can pass the variables on the url line, but you have to reference it by that scope:

e.g
<a href=&quot;searchresults.cfm?startyear=2001&startmonth=6&startday=1&quot;>Next Page</a>

Then modify your cfset somewhat:
<cfset startdate=#CreateDate('#url.startyear#','#url.startmonth#','#url.startday#')#>

 
Hi, CFDude

In my &quot;form page&quot;, I'm using:
<form action=&quot;A18.cfm&quot; method=&quot;post&quot; onsubmit=&quot;return checkform()&quot;>

can form page submit as URL.

And the value will pass in the action page is
<cfset startdate=#creadate('#form.statyear#','#form.startmonth#','#form.start.day#')#>

But the value of the date is optional, is not fixed value.
pls advise... thank you.
 
What do you mean by the date is optional? If the user doesn't put in a date, what is passed to the page?

I must be missing something here -- can you post your code? The cfset statement is correct (providing that there is a valid form value) so it has to be in the way the form values are getting passed (or not passed).

Tim P.
 
Hi, CFDude
here's the source code of my program(form page and action page):

My form page and program name:A18Recdate.cfm

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<cfinclude template=&quot;../template/header1.cfm&quot;>
<style>
.bu{ background-color: #ffcccc ; color=#003399}
</style>

<html>
<head>
<title>NEW PART NO MONTHLY</title>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#009900&quot;>
<center>
<h1><font color=&quot;#7373B9&quot;>*** INQUIRY BY RECEIVED DATE ***</font></h1>
<H2> (MONTHLY REPORT) </H2>
</center>

<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>

<!--- JavaScript section starts here --->
<script Language = &quot;javascript&quot;>

<!--- this is the main function, executed by pressing the submit button --->
<!--- This will initialize other functions coded below it, checking the --->
<!--- various differnt sections of the form, validating them --->
function checkform(){
if(StartMonthRange()){
if(EndMonthRange()){
if(ValidCheck()){
if(FilledBoxes()){
return true;
}
}
}
}
return false;
}

<!---This function checks wheather the use entered date is valid and --->
<!--- elminates ossibilites of the endate being earlier than the start date --->
function ValidCheck()
{
var month = document.forms[0].StartMonth.value
var day = document.forms[0].StartDay.value

if (month < 10){
nmonth = int(&quot;0&quot; + month)
window.alert(&quot;Month is now&quot;+nmonth)
}
else{
nmonth = month
}

if (day < 10){
nday = int(&quot;0&quot; + day)
window.alert(&quot;Month is now&quot;+day)
}
else{
nday = day
}

if (document.forms[0].StartYear.value > document.forms[0].EndYear.value){
window.alert(&quot;Invalid Choice -=Year=- Start Date Earlier Than End Date&quot;)
return false;
}
else if (document.forms[0].StartMonth.value > document.forms[0].EndMonth.value && document.forms[0].StartYear.value >= document.forms[0].EndYear.value){
window.alert(&quot;Invalid Choice -=Month=- Start Date Earlier Than End Date&quot;)
return false;
}
else if(document.forms[0].StartDay.value > document.forms[0].EndDay.value && document.forms[0].StartMonth.value >= document.forms[0].EndMonth.value){
window.alert(&quot;Invalid Choice -=Day=- Start Date Earlier Than End Date&quot;)
return false;
}else{
return true;
}
}

<!--- This function make sures all the date boxes are filled with a value for submission --->
function FilledBoxes()
{
if(document.forms[0].StartYear.value == &quot;Year&quot; && document.forms[0].EndYear.value == &quot;Year&quot; || document.forms[0].StartYear.value == &quot;Year&quot; && document.forms[0].EndYear.value != &quot;Year&quot; || document.forms[0].StartYear.value != &quot;Year&quot; && document.forms[0].EndYear.value == &quot;Year&quot; || document.forms[0].StartYear.value != &quot;Year&quot; && document.forms[0].EndYear.value != &quot;Year&quot;){
if(document.forms[0].StartMonth.value == &quot;Month&quot; && document.forms[0].EndMonth.value == &quot;Month&quot; || document.forms[0].StartMonth.value != &quot;Month&quot; && document.forms[0].EndMonth.value == &quot;Month&quot; || document.forms[0].StartMonth.value == &quot;Month&quot; && document.forms[0].EndMonth.value != &quot;Month&quot; || document.forms[0].StartMonth.value != &quot;Month&quot; && document.forms[0].EndMonth.value != &quot;Month&quot;){
if(document.forms[0].StartDay.value == &quot;Day&quot; && document.forms[0].EndDay.value == &quot;Day&quot; || document.forms[0].StartDay.value != &quot;Day&quot; && document.forms[0].EndDay.value == &quot;Day&quot; || document.forms[0].StartDay.value == &quot;Day&quot; && document.forms[0].EndDay.value != &quot;Day&quot;){
window.alert(&quot;Please fill in all date boxes&quot;)
return false;
}
}
}
return true;
}

<!--- currently unused --->
function MonthCheck()
{
if (document.forms[0].StartMonth.value > document.forms[0].EndMonth.value ){
window.alert(&quot;Invalid Choice -=Month=- Start Date Earlier Than End Date&quot;)
return false;
}
return true;
}

<!--- currently unused --->
function DayCheck()
{
if (document.forms[0].StartDay.value > document.forms[0].EndDay.value ){
window.alert(&quot;Invalid Choice -=Day=- Start Date Earlier Than End Date&quot;)
return false;
}
return true;
}

function EndMonthRange()
{
if(document.forms[0].EndDay.value == 31 && (document.forms[0].EndMonth.value == 2 || document.forms[0].EndMonth.value == 4 || document.forms[0].EndMonth.value == 6 || document.forms[0].EndMonth.value == 9 || document.forms[0].EndMonth.value == 11)){
window.alert(&quot;I'm Sorry, EndDay value exceeds months natrual range&quot;)
return false;
}
else if(document.forms[0].EndDay.value == 30 && (document.forms[0].EndMonth.value == 2 )){
window.alert(&quot;Febuary doesnt have 30 days&quot;)
return false;
}
return true;
}

function StartMonthRange()
{
if(document.forms[0].StartDay.value == 31 && (document.forms[0].StartMonth.value == 2 || document.forms[0].StartMonth.value == 4 || document.forms[0].StartMonth.value == 6 || document.forms[0].StartMonth.value == 9 || document.forms[0].StartMonth.value == 11)){
window.alert(&quot;I'm Sorry, StartDay value exceeds months natrual range&quot;)
return false;
}
else if(document.forms[0].StartDay.value == 30 && (document.forms[0].StartMonth.value == 2 )){
window.alert(&quot;Febuary doesnt have 30 days&quot;)
return false;
}
return true;
}

</script>
<!--- JavaScript Ends here --->
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>

<!---Query to retrieve day values from the DateRef_Day table --->
<cfquery name=&quot;getDay&quot; datasource=&quot;JESEng&quot;>
SELECT Day
FROM DateRef_Day
</CFQUERY>

<!---Query to retrieve day values from the DateRef_Month table --->
<cfquery name=&quot;getMonth&quot; datasource=&quot;JESEng&quot;>
SELECT Month
FROM DateRef_Month
</CFQUERY>

<!---Query to retrieve day values from the DateRef_Year table --->
<cfquery name=&quot;getYear&quot; datasource=&quot;JESEng&quot;>
SELECT Year
FROM DateRef_Year
</CFQUERY>

<form action=&quot;A18RecdateInquiry.cfm? method=&quot;post&quot; onsubmit=&quot;return checkform()&quot;>
<!--- This is where the form starts. --->
<!---Date Form sections starts here --->
<!--- This is where the 6 comboBoxes containing date values are coded--->
<DIV ALIGN=&quot;CENTER&quot;>
<table width=&quot;72%&quot; border=&quot;0&quot;>
<tr>
<td width=&quot;17%&quot;><b></b></td>
<td width=&quot;20%&quot;><b><font face=&quot;Times New Roman, Times, serif&quot; size=&quot;3&quot; color=&quot;#FF6CB6&quot;>Start
Date:</font></b> </td>
<td width=&quot;18%&quot;> <font face =&quot;Tahoma&quot; size=&quot;2&quot;>
<select name=&quot;StartDay&quot;>
<option value =&quot;Day&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>Day</font></option>
<cfoutput query=&quot;getDay&quot;>
<option value =&quot;#getDay.Day#&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>#getDay.Day#</font></option>
</cfoutput>
</select>
</font> </td>
<td width=&quot;21%&quot;> <font face =&quot;Tahoma&quot; size=&quot;2&quot;>
<select name=&quot;StartMonth&quot;>
<option value =&quot;Month&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>Month</font></option>
<cfoutput query=&quot;getMonth&quot;>
<option value =&quot;#getMonth.Month#&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>#getMonth.Month#</font></option>
</cfoutput>
</select>
</font> </td>
<td width=&quot;24%&quot;><font face =&quot;Tahoma&quot; size=&quot;2&quot;>
<select name=&quot;StartYear&quot;>
<option value =&quot;Year&quot;>Year</option>
<cfoutput query=&quot;getYear&quot;>
<option value =&quot;#getYear.Year#&quot;>#getYear.Year#</option>
</cfoutput>
</select>
</font></td>
</tr>
<tr>
<td width=&quot;17%&quot;><b></b></td>
<td width=&quot;20%&quot; > <font face =&quot;Tahoma&quot; size=&quot;2&quot;><b><font face=&quot;Times New Roman, Times, serif&quot; size=&quot;3&quot; color=&quot;#FF6CB6&quot;>End
Date:</font></b> </font></td>
<td width=&quot;18%&quot; > <font face =&quot;Tahoma&quot; size=&quot;2&quot;>
<select name=&quot;EndDay&quot;>
<option value =&quot;Day&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>Day</font></option>
<cfoutput query=&quot;getDay&quot;>
<option value =&quot;#getDay.Day#&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>#getDay.Day#</font></option>
</cfoutput>
</select>
</font></td>
<td width=&quot;21%&quot; ><font face =&quot;Tahoma&quot; size=&quot;2&quot;>
<select name=&quot;EndMonth&quot;>
<option value =&quot;Month&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>Month</font></option>
<cfoutput query=&quot;getMonth&quot;>
<option value =&quot;#getMonth.Month#&quot;><font face=&quot;Tahoma&quot; size=&quot;2&quot;>#getMonth.Month#</font></option>
</cfoutput>
</select>
</font> </td>
<td width=&quot;24%&quot; > <font face =&quot;Tahoma&quot; size=&quot;2&quot;>
<select name=&quot;EndYear&quot;>
<option value =&quot;Year&quot;> Year </option>
<cfoutput query=&quot;getYear&quot;>
<option value =&quot;#getYear.Year#&quot;>#getYear.Year# </option>
<!---Date Form sections ends here --->
</cfoutput>
</select>
</font> </td>
<tr>
<td colspan=&quot;5&quot;>
<div align=&quot;center&quot;>
<!--- The submit button to proceed to the action page --->
</div>
</td>
</tr>
</table>
<p>&nbsp;</p>
<input type=&quot;submit&quot; value=&quot;Submit&quot; class=&quot;bu&quot;>
<p>&nbsp;</p>
</div>
</form>
</body>
</html>
<cfinclude template=&quot;../template/footer.cfm&quot;>

And here's my action page and program name:A18RecdateInquiry.cfm

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<cfinclude template=&quot;../template/header1.cfm&quot;>
<style>
.bu{ background-color: #ffcccc ; color=#003399}
</style>

<!-- intialize constants -->
<CFSET MaxRows = 20>

<!-- intialize all fields if they do not exist -->
<CFPARAM NAME=&quot;start&quot; DEFAULT=&quot;1&quot;>
<CFPARAM NAME=&quot;A18model&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;DwgNo&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;DwgNm&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18suppcode&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18sub&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18recdate&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18issdept&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18issdate&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18rmk&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18jud&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18appdate&quot; DEFAULT=&quot;&quot;>
<CFPARAM NAME=&quot;A18duedate&quot; DEFAULT=&quot;&quot;>

<!--- <cfset startDate = #CreateDate(2001,9,1)#> --->
<!--- <cfset endDate = #CreateDate(2001,9,30)#> --->
<cfset startDate = #CreateDate('#FORM.StartYear#','#FORM.StartMonth#','#FORM.StartDay#')#>
<cfset endDate = #CreateDate('#FORM.EndYear#','#FORM.EndMonth#','#FORM.EndDay#')#>

<cfoutput>
<font face= &quot;Times New Roman, Times, serif&quot; size=&quot;2&quot;>
<b> You have selected the date range of <i>#DateFormat(startDate,&quot;dd/mm/yyyy&quot;)#</i>
to <i>#DateFormat(endDate,&quot;dd/mm/yyyy&quot;)#</i> </b></font>
</cfoutput>

<!-- perform actual search -->
<cfquery name=&quot;ViewA18Recdate&quot; datasource=&quot;JESEng&quot; dbtype=&quot;ODBC&quot;>
SELECT Drawing.DwgNo,Drawing.DwgNm,A18NewPart.A18model,A18NewPart.A18suppcode,
A18NewPart.A18sub,A18NewPart.A18recdate,A18NewPart.A18issdept,A18NewPart.A18issdate,
A18NewPart.A18rmk,A18NewPart.A18jud,A18NewPart.A18appdate,A18NewPart.A18duedate
FROM qryA18
WHERE A18NewPart.A18recdate >= #startDate#
AND A18NewPart.A18recdate <= #endDate#
ORDER BY Drawing.DwgNo
</cfquery>

<!-- send user to an error page if query outputs no data -->
<cfif #ViewA18Recdate.A18recdate# eq &quot;&quot;>
ERROR!!! Received Date Was Not Specified!!!
<meta http-equiv=refresh content=&quot;2;url=..\A18\A18Recdate.cfm&quot;>
</cfif>

<cfset ToRow = start + (MaxRows -1)>
<cfif ToRow GT ViewA18Recdate.RecordCount>
<cfset ToRow = ViewA18Recdate.RecordCount>
</cfif>

<html>
<head>
<title>IQC NEW PART MASTER</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#3333cc&quot;>
<h1><div align=&quot;center&quot;><font color=&quot;##7355B9&quot;>LIST OF NEW PARTS (RECEIVED DATE)</h1></div></font>
<cfoutput>
<h2><font color=&quot;##6473B9&quot;>Total Records To View Are: <font color=&quot;##DF00DF&quot;>#ViewA18Recdate.RecordCount#</font></font></h2>
</cfoutput>
<!-- create table for display -->
<TABLE BORDER=&quot;2&quot; cellpadding=0 cellspacing=1 bordercolor=&quot;#993399&quot;>
<!-- table hearders -->
<TR>
<TH><font color=&quot;#cc6666&quot;>Model</font></TH>
<TH><font color=&quot;#cc6666&quot;>Part No</font></TH>
<TH><font color=&quot;#cc6666&quot;>Part Name</font></TH>
<TH><font color=&quot;#cc6666&quot;>SuppCode</font></TH>
<TH><font color=&quot;#cc6666&quot;>Sub</font></TH>
<TH><font color=&quot;#cc6666&quot;>Rec.Date</font></TH>
<TH><font color=&quot;#cc6666&quot;>Iss.Dept</font></TH>
<TH><font color=&quot;#cc6666&quot;>Iss.Date</font></TH>
<TH><font color=&quot;#cc6666&quot;>Remark</font></TH>
<TH><font color=&quot;#cc6666&quot;>Jud</font></TH>
<TH><font color=&quot;#cc6666&quot;>App.Date</font></TH>
<TH><font color=&quot;#cc6666&quot;>Due Date</font></TH>
</TR>

<!-- write out the retrieved data -->
<CFOUTPUT QUERY=&quot;ViewA18Recdate&quot; STARTROW=&quot;#start#&quot; MAXROWS=&quot;#Maxrows#&quot;>
<TR>
<TD>#Trim(A18model)#</TD>
<TD>#Trim(DwgNo)#</TD>
<TD>#Trim(DwgNm)#</TD>
<TD ALIGN=&quot;CENTER&quot;>#Trim(A18suppcode)#</TD>
<TD ALIGN=&quot;CENTER&quot;>#Trim(A18sub)#</TD>
<TD>#Trim(A18recdate)#</TD>
<TD ALIGN=&quot;CENTER&quot;>#Trim(A18issdept)#</TD>
<TD>#Trim(A18issdate)#</TD>
<TD ALIGN=&quot;CENTER&quot;>#Trim(A18rmk)#</TD>
<TD ALIGN=&quot;CENTER&quot;>#Trim(A18jud)#</TD>
<TD>#Trim(A18appdate)#</TD>
<TD>#Trim(A18duedate)#</TD>
</TR>
</CFOUTPUT>
</TABLE>
<TR>
<!-- what are the previous and next row to start positions -->
<CFSET PrevStart = start - MaxRows>
<CFSET NextStart = start + MaxRows>

<!-- previous button code -->
<TD COLSPAN =&quot;3&quot; ALIGN=&quot;Center&quot;>
<CFIF PrevStart GTE 1>
<CFOUTPUT>
<FORM ACTION=&quot;A18RecdateInquiry.cfm&quot; METHOD=&quot;POST&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;start&quot; VALUE=&quot;#PrevStart#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18model&quot; VALUE=&quot;#A18model#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;DwgNo&quot; VALUE=&quot;#DwgNo#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;DwgNm&quot; VALUE=&quot;#DwgNm#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18suppcode&quot; VALUE=&quot;#A18suppcode#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18sub&quot; VALUE=&quot;#A18sub#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18recdate&quot; VALUE=&quot;#A18recdate#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18issdept&quot; VALUE=&quot;#A18issdept#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18issdate&quot; VALUE=&quot;#A18issdate#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18rmk&quot; VALUE=&quot;#A18rmk#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18jud&quot; VALUE=&quot;#A18jud#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18appdate&quot; VALUE=&quot;#A18appdate#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18duedate&quot; VALUE=&quot;#A18duedate#&quot;>
<BR>
<A HREF=&quot;../A18/A18RecdateInquiry.cfm?start=#PrevStart#&quot;><font size=&quot;+1&quot;>Previous #MaxRows#</font>
<B><strong> | </strong></B>
<A HREF=&quot;../A18/A18Recdate.cfm&quot;><font size=&quot;+1&quot;>BACK</font></A>
</FORM>
</CFOUTPUT>
</CFIF>
</TD>
<!-- next button code -->
<TD COLSPAN =&quot;3&quot; ALIGN=&quot;Center&quot;>
<CFIF NextStart LTE ViewA18Recdate.RecordCount>
<CFOUTPUT>
<FORM ACTION=&quot;A18RecdateInquiry.cfm&quot; METHOD=&quot;POST&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;start&quot; VALUE=&quot;#NextStart#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18model&quot; VALUE=&quot;#A18model#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;DwgNo&quot; VALUE=&quot;#DwgNo#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;DwgNm&quot; VALUE=&quot;#DwgNm#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18suppcode&quot; VALUE=&quot;#A18suppcode#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18sub&quot; VALUE=&quot;#A18sub#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18recdate&quot; VALUE=&quot;#A18recdate#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18issdept&quot; VALUE=&quot;#A18issdept#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18issdate&quot; VALUE=&quot;#A18issdate#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18rmk&quot; VALUE=&quot;#A18rmk#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18jud&quot; VALUE=&quot;#A18jud#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18appdate&quot; VALUE=&quot;#A18appdate#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;A18duedate&quot; VALUE=&quot;#A18duedate#&quot;>
<BR>
<A HREF=&quot;../A18/A18RecdateInquiry.cfm?start=#NextStart#&quot;><font size=&quot;+1&quot;>Next #MaxRows#</font>
<B><strong> | </strong></B>
<A HREF=&quot;../A18/A18Recdate.cfm&quot;><font size=&quot;+1&quot;>BACK</font></A>
</FORM>
</CFOUTPUT>
</CFIF>
</TD>
</TR>
</body>
</html>
<cfinclude template=&quot;../template/footer.cfm&quot;>

THANK YOU....
 
You are not posting the data to the A18RecdateInquiry.cfm page with your link. An href link is not the same thing as a form post. It is not seeing your form.year, etc because those variables do not exist.

Change this:
<A HREF=&quot;../A18/A18RecdateInquiry.cfm?start=#NextStart#&quot;><font size=&quot;+1&quot;>Next #MaxRows#</font>

to

<input type = hidden name=&quot;start&quot; value = &quot;#NextStart#&quot;>
<input type = submit value=&quot;Next #MaxRows#&quot;>

The other way to do it would be to put all the variables on the href line, and change the way you reference them.

e.g
<A HREF=&quot;../A18/A18RecdateInquiry.cfm?start=#NextStart#&A18model=#A18model#&DwgNo=#DwgNo#&DwgNm=#DwgNm#&quot;><font size=&quot;+1&quot;>Next #MaxRows#</font>

(I only put the first 3, but you have to put all of the on the url for the next page to &quot;see&quot; them.

Then on the A18RecDateInquiry.cfm, you have to change the scope to url:


<cfset startDate = #CreateDate('#URL.StartYear#','#URL.StartMonth#','#URL.StartDay#')#>
<cfset endDate = #CreateDate('#URL.EndYear#','#URL.EndMonth#','#URL.EndDay#')#>


If you change it to use the URL instead of form, then the first form will not work since you are posting that data. Change the method=&quot;post&quot; to method=&quot;get&quot; and it will do the same thing.
 
it still can't works.....

Is there any way to keep the value to return to the <cfset startdate=#creadate('#form.satartyear#'.....)>, after click on the next button....
eg:
total record to view are 137

maximum view per screen is 20 records, so the balance records should view very screen is 20 records.

Thank you.
 
This is getting difficult to diagnose here. When you say it doesn't work -- what is the error or problem?

I still think the problem lies in the way you are going from one page to another. If you want to use form variables, you must use a form method of post and use a submit button to do it.

 
Hi, CFDude

Thanks for your help, finally I get it. Thank you.
 
Pass data of javascript to cold fusion.
For example:
<cfquery name=&quot;hola&quot; &quot;bd&quot;>
SELECT hola FROM jasdkj
WHERE si = ¿¿¿(form0.capo.value)???
How can I access to this value with cold fusion???
thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top