Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 06-26-2009, 02:25 PM
  #1
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
Pulling Data In A Popup

I have a site that I'm wanting to sell goods on. On a particular page, I want a user to be able to click on a "purchase" link and have a popup show with a form to fill out that gets sent to me via email (Im going to be using PayPal for the processing). The url for each item is different because the last digit is the unit number of the item.

Here is an example: http://www.sthompsonphoto.com/index.php?showimage=17

How can I add "17" to a field in the form when the pop-up happens? Any ideas?

Thank you very much in advance!

Scott T.
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-26-2009, 02:36 PM
  #2
legersolutions
Aspirant (Level 2)
 
legersolutions's Avatar
 
Join Date: Jun 2009
Location: Madurai, India
Posts: 10
iTrader: (0)
legersolutions is an unknown quantity at this point
Thumbs up Append the url using Javascript

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--

function changeURL(n)
{
window.open("http://www.sthompsonphoto.com/index.php?showimage=" + n);
}

//-->
</script>


</head>

<a href="javascript:changeURL(1)">1</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="javascript:changeURL(2)">2</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="javascript:changeURL(3)">3</a>
</body>
</html>

legersolutions is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-26-2009, 03:28 PM
  #3
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
Im a tad on the confused side. Would this be the code for the popup or the code for the page that I sent you? Sorry.

OH! I see now what you've done. But, all I need is this:

You make your way to http://www.sthompsonphoto.com/index.php?showimage=17 and decide you want to buy it. You click on "purchase" and a popup shows up with a form containing fields for your name, email, address, AND a field for the item number. I want that item number to be pulled from the URL, in this case "17".

OR, can you, instead of the URL, pull a word from the actual site? Or in the HTML?

Hope that makes more sense. Sorry if I didnt explain it correctly!

Last edited by scottdog129a : 06-26-2009 at 03:44 PM.
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-27-2009, 05:08 AM
  #4
legersolutions
Aspirant (Level 2)
 
legersolutions's Avatar
 
Join Date: Jun 2009
Location: Madurai, India
Posts: 10
iTrader: (0)
legersolutions is an unknown quantity at this point
Thumbs up Get URL Parameters (QueryStrings) using Javascript

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--

function changeURL(n)
{
window.open("http://www.sthompsonphoto.com/index.php?showimage=" + n);
}

function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}

function showParameters()
{
alert(getQuerystring('showimage'));
}

//-->
</script>


</head>
<body onload="showParameters()">
<a href="javascript:changeURL(1)">1</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="javascript:changeURL(2)">2</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="javascript:changeURL(3)">3</a>
</body>
</html>

Hope this will help u...

legersolutions is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 11:00 AM
  #5
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
Thanks for the post, but its giving me a Javascript error when I test it. Also, there is no popup. It just goes to my website.
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 12:44 PM
  #6
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
Actually, it might be easier to just pull the picture name off the site. I think there is a tag in the HTML that is named <IMAGE_NAME>. Can THAT be used to fill in the image name field in the form that pops up?
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 12:51 PM
  #7
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there Scott,

check out the attachment, starting at "brief notes".
Attached Files
File Type: zip scott.zip (64.2 KB, 2 views)
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 01:34 PM
  #8
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
This is AMAZING!! Thank you! IS there a possible way to use the image name? The only reason that I ask is because when you first go to the site, the URL doesnt show a number. Also, it might be a little easier down the road.

Last edited by scottdog129a : 06-29-2009 at 01:40 PM.
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 01:51 PM
  #9
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there Scott,

no problem, here is the revision...
Attached Files
File Type: zip scott_revision.zip (64.4 KB, 2 views)
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 02:05 PM
  #10
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
Hey coot. Thank you so much, but its just displaying the image FILE name, not the actual name. Is this even possible? The photoblog software Im using uses the tag <IMAGE_NAME> to display the image on my site. Can this be used?
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 02:08 PM
  #11
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there Scott,

just in case you meant that you don't want the "link_to_index.html", then use this...
Attached Files
File Type: zip scott_revision_1.zip (63.5 KB, 2 views)
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 02:22 PM
  #12
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there Scott,
Quote:
..its just displaying the image FILE name, not the actual name
You are moving the goal posts again.

We started with a simple...
"17"
...then moved on to...
"20090623164710_pic17.jpg"
...and now you want some...
"IMAGE_NAME".
Where, actually, in the "index.php" do we find this...
"IMAGE_NAME".
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 02:29 PM
  #13
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
Im so sorry for being a pain. I apologize. Im not much of a php person, but Im guessing its around line 474 of the php file. I could be wrong and most likely am.

You can view the file that I change to change the site here:

http://www.sthompsonphoto.com/templa..._template.html

And its <IMAGE_TITLE>, not <IMAGE_NAME>. My bad.

Thank you SO VERY MUCH for your help!
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 03:26 PM
  #14
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there Scott,

Right, I see that you require the title attribute of the image to be sent to the form.
This, again presents no problem.

Note:-

IE will display "Coffee House Street" the others "Coffee%20House%20Street".
Attached Files
File Type: zip scott_revision_2.zip (63.5 KB, 4 views)
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-29-2009, 04:16 PM
  #15
scottdog129a
Swordman (Level 9)
 
scottdog129a's Avatar
 
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
iTrader: (0)
scottdog129a is an unknown quantity at this point
Coothead, I swear I owe you big time! Thank you so very much for ALL your help!
scottdog129a is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


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



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 11:47 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.