ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 18th, 2005, 04:41 AM
mayasaliba mayasaliba is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 mayasaliba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 42 sec
Reputation Power: 0
Red face undifined variable

hi, i am new coldfusion programmer
i have 2 pages
in the first page we choose a conference room and we click on a submit for viewing the shcedule of this room in the second page where date=#searchdate#

<cfparam name="searchdate" default="#now()#">

<center> <h2><span class="textbox">#dateformat(searchdate,'dddd d mmmm yyyy')#</span>
</h2></center>
<cfset nextday = dateadd("d", 1, #searchdate#)>
<cfset prevday = dateadd("d", -1, #searchdate#)>
<cfset nextday=#dateformat(nextday, 'mm/dd/yyyy')#>
<cfset prevday=#dateformat(prevday, 'mm/dd/yyyy')#>

<table width="97%" height="21">
<tr>

<td width="37%" align="right" ><img name="btnprev" src="images/previmage.gif" align="absmiddle" alt="Previous Day" onClick="changedate('#prevday#')" > Go to day before</td>
<td width="22%" align="center" ><a href="roomschedule.cfm">Go to today</a></td>
<td width="41%" align="left" >Go to day after <img name="btnnext" src="images/nextimage.gif" align="absmiddle" alt="Next Day" onClick="changedate('#nextday#')"></td>

</tr>
</table>


/////////////////////////
this is the function changedate()


function changedate(a)
{
var id ;
var id = a;
var page = "roomschedule.cfm?";
page =page + 'searchdate=' + id;
window.location=(page);
}



when i click on nextday the error occured Variable ROOM is undefined, because room is comming from the first page.
i tried to use "input type=hidden" but there is no submit buttom.

i will be thankfull for u
Maya

Reply With Quote
  #2  
Old January 18th, 2005, 07:49 AM
fortunato fortunato is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 33 fortunato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 36 m 52 sec
Reputation Power: 4
If I understand correctly, and you have received ROOM from the previous page, then you can just add it as another parameter in your url as a part of your javascript function. Below should work if ROOM was sent as part of the url, if ROOM was sent as part of a form submit from your first page, then use #form.room# instead of #url.room#.

For url strings, use ampersands to connect multiple variables, I put that in the page update line. Also, you will need to be sure that it is enclosed in <cfoutput> tags so that the #signs get evaluated HTH

<cfoutput>
function changedate(a)
{
var id ;
var id = a;
var page = "roomschedule.cfm?room=#url.room#";
page =page + '&searchdate=' + id;
window.location=(page);
}
</cfoutput>

Reply With Quote
  #3  
Old January 25th, 2005, 03:02 AM
mayasaliba mayasaliba is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 mayasaliba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 42 sec
Reputation Power: 0
Quote:
Originally Posted by fortunato
If I understand correctly, and you have received ROOM from the previous page, then you can just add it as another parameter in your url as a part of your javascript function. Below should work if ROOM was sent as part of the url, if ROOM was sent as part of a form submit from your first page, then use #form.room# instead of #url.room#.

For url strings, use ampersands to connect multiple variables, I put that in the page update line. Also, you will need to be sure that it is enclosed in <cfoutput> tags so that the #signs get evaluated HTH

<cfoutput>
function changedate(a)
{
var id ;
var id = a;
var page = "roomschedule.cfm?room=#url.room#";
page =page + '&searchdate=' + id;
window.location=(page);
}
</cfoutput>



thank you very much it's working...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > undifined variable


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway