SunQuest
           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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 16th, 2004, 02:38 AM
FrozenShade FrozenShade is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 10 FrozenShade User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passing form values to popup

Here is my dilemma. I'm using Matt Robinson's mail script (found here http://mysecretbase.com/Slowing_Down_CFMAIL.cfm) to slow down cfmail. However, instead of converting this entirely to fusebox, I want to open the cfmail page in a popup window (launched from a form) and have certain form fields passed to this window. Some code will help explain.

In the form, the client chooses which database they want to mail to....

=========================
in dsp_emailUsers.cfm

<cfparam name="subject" default="">
<cfparam name="emailtype" default="">
<cfparam name="town" default="">
<cfparam name="whichtable" default="">

<script type="text/javascript">
function formpop() {
formWin = window.open('http://www.myurl.com/newsletter/admin/index_mailbomb.cfm?&bombsaway=true&subject=form.subject&emailtype=form.emailtype&whichtable=form.whichtable&town=form.town','ScapeBomb','width=300,height=300,toolbar=no,location=no,directories=no,status=no,me nubar=no,scrollbars=no,resizable=yes');
if (formWin && !formWin.closed)
formWin.focus();
return true;
}

<h2>S'cape Mailer </h2>
<cfoutput>
<form method="post" action="#self#?fuseaction=#xfa.emailSuccess#" name="scapemailer"
class="center" onsubmit="return formpop()"></cfoutput>
<div class="admin">
Subject: <br />
<input type="text" name="subject" size="50" style="margin-top:5px;" />
<br /><br />
Choose the mail format:
<input type="radio" name="emailtype" value="text" class="radio">
Plain text
<input type="radio" name="emailtype" value="html" class="radio">
HTML<br /><br />
Choose a database:
<input type="radio" name="whichtable" value="client_test" class="radio">
Send Test
<input type="radio" name="whichtable" value="client" class="radio">
Go Live
<br />
</p>
<br /><br />
<input name="submit" type="submit" value="Send mail" class="button" />
</div>
</form>

<cfelse>
<cflocation URL="#self#?fuseaction=#XFA.loginFailed#&badLogin=true">
</cfif>

This seems to be fine, UNTIL it goes to query the email database with the whichtable variable... in the ebomb_pop.cfm file

=================

<cfsilent>

<!--- standard variables --->
<cfset admin_mail = "server@cwc.co.nz">
<cfset ebomb_filename = "scapebomb_test.html">
<cfset request.dsn="scape">
<!--- TEST THREAD --->

<!--- Run Rate is the number of seconds between refresh --->
<cfset variables.RunRate=20>

<!---
Query Run is the number of query rows (email addresses)
that will be processed on each execution of this template
--->
<cfset variables.QueryRun=50>

<!---
pull the email addresses. Cache this query since its
going to be re-used every few seconds.
--->
<cfquery
datasource="#request.dsn#"
name="MailList"
cachedwithin="#CreateTimeSpan(0,1,0,0)#">
SELECT
email
FROM
#whichtable#
WHERE
email IS NOT NULL
</cfquery>
etc etc

it barfs and returns a whacky msaccess application error about 'C:\winnt\form.mdb
could not be found'. But if I hardcode either client, or client_test in place of #whichtable#, everything works fine.
Any ideas why this is happening?

It's quite odd , bcos the other variables are passed just fine, and on the post process page of the original form I checked by outputting the value #whichtable#, and it always displays either client or client_test depending on which I have chosen.

Maybe I need to use javascript to call the values in the popup?

All help greatly appreciated.

TIA
MarkH

Reply With Quote
  #2  
Old September 16th, 2004, 04:13 PM
bocmaxima's Avatar
bocmaxima bocmaxima is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2004
Location: Tucson, Sonora
Posts: 1,322 bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 17 h 46 m 5 sec
Reputation Power: 22
Send a message via AIM to bocmaxima
You're hashing in the variable "whichtable" as if it were a local or global CF variable, however it is a URL variable, so you need to identify it as such unless you have a procedure to convert URL variables in place:
#URL.whichtable#
Also, have you looked at the URL that's coming in the pop-up?
You're putting in form variables correctly, but not hashing them in so ColdFusion will just interpret the string literally.
http://www.myurl.com/newsletter/admin/index_mailbomb.cfm?&bombsaway=true&subject=#form.subject#&emailtype=#form.emailtype#
etc.

MOST IMPORTANTLY, this whole thing will not work. You're trying to pull form variables into a JavaScript from the existing page. You can't do that. You need to re-arrange your whole system, mainly by using JavaScript to populate your URL string, or using the GET method for your form.

Reply With Quote
  #3  
Old September 17th, 2004, 06:56 PM
FrozenShade FrozenShade is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 10 FrozenShade User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks for the reply bocmaxima,
it turns out that after all this a database for additional features was required and that made my job a lot easer..problem now solved.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Passing form values to popup


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 6 hosted by Hostway