Current location: Hot Scripts Forums » General Web Coding » JavaScript » Help with image on form...


Help with image on form...

Reply
  #1 (permalink)  
Old 10-05-04, 01:31 AM
Adrianaa03 Adrianaa03 is offline
New Member
 
Join Date: Sep 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Help with image on form...

I'm having some trouble with a form on my website. What I've done is passed an image from one page to another using this script:

<script language="JavaScript" type="text/javascript">
<!--

if (location.search) {
var image_filename = location.search.substring(1)
document.write('<IMG SRC="' + image_filename + '" width="110"
height="80">')
}
//-->
</script>

This is working great and the image shows up in the form just where I want it. Problem is, I don't know how to get this image (not the actual image but at least the image filename) to get sent to me through email when the user hits the submit button. Everything else on the form gets sent to me except this image (the image will always be different depending on what image was clicked on the page before) I also want to send this image to a confirmation page. Can someone please help me out with this?
Thanks...Adriana
Reply With Quote
  #2 (permalink)  
Old 10-06-04, 07:38 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
<script language="JavaScript" type="text/javascript">
<!--

if (location.search) {
var image_filename = location.search.substring(1)
document.write('<IMG SRC="' + image_filename + '" width="110" 
height="80"><input type="hidden" name="image_src" value="'+image_filename+'">')
} 
//-->
</script>
That should be enough to send the image's filename to your email along with the form. To get the image on the confirmation page I suggest you add the filename to a cookie and then use a second script on the confirmation page to read the cookie and load the script.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
formmail problem gscraper Perl 12 08-27-04 03:06 AM
how to draw an image inside a table? davidklonski HTML/XHTML/XML 2 07-06-04 10:27 AM
Limit the form submission according to time bionicsamir PHP 7 05-09-04 11:10 PM
Put a small icon image into a HTML form button. birdie_nam_nam JavaScript 4 02-25-04 01:24 AM


All times are GMT -5. The time now is 10:31 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.