Click <a href="javascript:doform();">here</a> to tell a friend.
</form>
-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
The window opens, but it doesn't seem to load correctly. Any further ideas?
Need a better explaination than that...?
By the time I viewed the page, it had sad69's script in it....
-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
The above is what is written to the popup you're opening using the code I posted.
What is it you are trying to do? Do you want to create a new document using Javascript or Cold Fusion? Are you trying to pass data to a backend script, or just pass form values to the next page?
If this what you want, you can do away with the form, assuming it'll be submitted from the popup:
Click <a href="javascript:doform();">here</a> to tell a friend.
innerHTML is not x-browser/backwards friendly...
-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
Last edited by jamescover; 07-15-2004 at 07:23 PM..
You'll see I have an "EMAIL A FRIEND" image under the left nav. I want to call that same for with a text link in the right-hand column. It should pull up the same pop-up and pass the values (window.location and document.title).
So why not pass these to the Cold Fusion script...
-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
Last edited by jamescover; 07-15-2004 at 08:32 PM..
I think I'm getting in over my head. I don't really understand "<\/a>" for starters. I guess since I've already got the form working perfectly in the left nav using an image submit that it wouldn't be that difficult to simply convert to a link submit. Maybe I'm wrong.
I still don't understand why this code doesn't work:
Because you're doing the document.write(), but where are you writing it? document.write() just appends to the end of the page, so in your case, you wouldn't be writing those hidden elements within your form tags, so those hidden inputs wouldn't get submitted.
That's why I gave you my code to grab the form element, and append to the end of its innerHTML. I'm not sure why it isn't working for you... did you set the 'id' of the form tag like I showed you in my post? That way you use getElementById to get that element, and then write to the end of it.
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
Quote:
Originally Posted by sad69
That's why I gave you my code to grab the form element, and append to the end of its innerHTML. I'm not sure why it isn't working for you... did you set the 'id' of the form tag like I showed you in my post? That way you use getElementById to get that element, and then write to the end of it.
Sadiq.
The reason it didn't work is because you missed the quotes.
var frm = document.getElementById('TellaFriendform');
But here's the simplest solution:
Code:
<form action="/TellAFriend/SendToFriend.cfm" method="post" name="TellaFriendform" target="myWindowName" onSubmit="window.open('about:blank',this.target,'width=400,height=375');">
<input type="hidden" name="PageLinkStatic" />
<input type="hidden" name="Title" />
<script language="JavaScript" type="text/javascript">
<!--
function doform()
{
var f = document.TellaFriendform;
f.PageLinkStatic.value = location.href;
f.Title.value = document.title;
f.submit();
return false;
}
//-->
</script>
Click <a href="#" onclick="return doform()">here</a> to tell a friend.
</form>
Error Occurred While Processing Request
Error Diagnostic Information
Just in time compilation error
Invalid parser construct found on line 182 at position 43. ColdFusion was looking at the following text:
"
Invalid expression format. The usual cause is an error in the expression structure.
The last successfully parsed CFML construct was dynamic text (a CFML expression) occupying document position (166:43) to (166:63).
The specific sequence of files included or processed is:
D:\USERS\PFM\WWW\WILBERFORCETEMPLATE.CFM
D:\USERS\PFM\WWW\WILBERFORCENPI.CFM CFInclude
The error occurred while processing an element with a general identifier of (CFINCLUDE), occupying document position (285:3) to (285:43).
Date/Time: 07/16/04 09:13:08
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Remote Address: 206.154.235.76
Query String: Section=National_Preaching_Initiative