|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help with "email link to friend" application
Hi all,
I recently read a tutorial on how to create an "email link to friend" pop-up window that has a form with the fields email, youremail, and yourname. Here is how the current page URL is being stored: <snippets from my code> <!---this is in between the head tags to open the small java window OnClick---> <script language="JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <!---this is the link that's clicked to execute the send email form window---> Send this page <a href="javascript:;" onClick="MM_openBrWindow('tellafriend.cfm?addy=https://secure01.dataride.com<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>?NewsID=<cfoutput>#NewsID#</cfoutput>&AuthorID=<cfoutput>#GetAuthorDetail.AuthorID#</cfoutput>' ,'friend','scrollbars=yes,width=500,height=350')">Email to friend</a> ******** Now, everything is working fine, except the URL variable "addy" is not incorporating the second variable in the query string, "AuthorID. Here is the actual tellafriend.cfm file: ---------------------------------------------------- <body> <cfif IsDefined("form.email")> <cfmail to="#form.email#" from="#form.youremail#" subject="A Message from a friend"> #FORM.Message# #FORM.link# Enjoy! #Form.YourName# </cfmail> <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="images/mainlogo.gif"></td> </tr> <tr> <td align="center" valign="middle">The article and message was sent to the specified addresses.<br><br> <form><input type="button" value="Close" onClick="self.close()"></form></td> </tr> </table> <cfelse> <cfset session.addy = url.addy> <!-- Here is the form ---> <form action="tellafriend.cfm?<cfoutput>#session.URLToken#</cfoutput>" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="right">Friends Email:</div></td> <td><input name="email" type="text" size="30" maxlength="150"></td> </tr> <tr> <td><div align="right">Your Name:</div></td> <td><input name="yourname" type="text" size="30" maxlength="150"></td> </tr> <tr> <td><div align="right">Your Email:</div></td> <td><input name="youremail" type="text" size="30" maxlength="150"></td> </tr> <tr> <td><div align="right"> <p>Your Message:</p> </div></td> <td><textarea name="Message" cols="40" rows="5"></textarea></td> </tr> <tr> <td colspan="2" align="center"><input name="" type="submit" value="Send"></td> </tr> </table> <input type="hidden" name="link" value="<cfoutput>#URL.addy#</cfoutput>"> </form> </body> </html> </cfif> ------------------------------------------------------------ Any thoughts??? |
|
#2
|
|||
|
|||
|
You have 2 ? in your javascript - I am no javascript guru but maybe that is a problem??? Here is what I have had success using... this is asp but see no reason why it would not work in CF.
<script language="javascript"> <!-- function interested(txt){var winX=0;var winY=0; if(parseInt(navigator.appVersion)>=4){X=(screen.availWidth-355)*.5;Y=(screen.availHeight-470)*.5;} popupWin = window.open('order.asp'+txt , 'ctc' , 'height=470,width=355,resizable=0,scrollbars=0,lef t='+X+',top='+Y);} //--> </script> yadda yadda yadda <a href="javascript:;" class="salecontact" onClick="interested('?interest=1400')">Contact Us</a> Just put your cfoutput wherever it needs to be. Good Luck, Jim S. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Cold Fusion Development > Need help with "email link to friend" application |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|