javascript for forwarding text/no's?

P

Peter Goldfield

Wonderful people here have helped me succeed in forwarding pictures to
pages!
sample:
http://www.duckspool.com/goldfield/shows/afss/afss_detail/waspssp.htm
click on offer or buy to see the picture going forward.
Now I'm on a sort of roll I want to pick up the name of the picture and the
price and put them in the forms. Preferably by picking these items from the
page.
Is there a way to do this similar to the picture? Should the name and price
be placed in some sort of box?
 
T

Thomas A. Rowe

So we each get to choose free a picture, correct? <vbg>

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
 
P

Peter Goldfield

yes - by e-mail - you have to print it! - resolution- now that's where we
can haggle! (extravbg)
 
S

Steve Easton

Dang you're a glutton for punishment. ;-)

Poke around here:
http://www.gatescript.com/default.asp

You will need to name *all* forms and elements that you are going to read
from and write to with id="formname" and id="elementname"

You will need to use "global variables" to hold the data after you capture
it.
Global variables are set like this, before and above any functions:
<script language="javascript">
var picturename;
var pictureprice;

You will need a function to capture it and assign it to a global variable
and write it to the form.
function getandwrite(){
picturename = elementname#1.value;
pictureprice = elementname#2.value;
document.all.formname.elementname#1.innerHTML = "picturename";
document.all.formname.elementname#2.innerHTML = "pictureprice";
}

and you will need to fire the funtion with either a body or window onload

Hope this gives you a starting point.
--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Peter Goldfield

thank you Robo,

I'll get on to that and make a pretty results form at the same time. Feels
like i have guardian angels....
 
P

Peter Goldfield

Hmm - I think it's 36dpi so far...(g)
I was rather hoping that the reply would be something like the one Jim
(Buyens) gave me last week - put 'this' script in the head and 'this' one in
the body and then change the parameters in the link from "A" to "B"!
If the head script were the same (as I've got for the picture), and the body
script "<script>
document.write('<img src="' + getqsvar("pic") + '">');"
</script>
were put in a second/third time with changing "pic" to "name" and "price"
all I'd need to do would point the parameter value for "name" and "price" to
what???? I suppose I could make .jpg's of names and prices but that seems a
bit longwinded and tedious - as somebody said somewhere "there must be a
better way (that doesn't need asp's and databases....)"

It's probably pie in the sky, but first set of hints is beyond me - honestly
did bumble around the link but just not up to it...
 
C

Crash Gordon

the whole werld is watching :)



| thank you Robo,
|
| I'll get on to that and make a pretty results form at the same time. Feels
| like i have guardian angels....
|
|
 
J

Jim Buyens

You could do this my coding anchor tags like:

<a href="detpage.htm?pic=bumblebees.jpg&name=Bumble+Bees&price=500">

Notice that ampersands separate each name=value pair, and that you
have to URLencode spaces and special characters. To display this value
in the detpage.htm page, you would code, for example,

<script>document.write(getqsvar.name);</script>

and to let a form submission pick it up, you would code:

<script>document.write("<input type='hidden' name='name' value='" +
getqsvar("name") + "'>");</script>

But I must tell you, it appears you're trying to build a complete
storefront application here, and at some point (perhaps soon) you're
likely to hit a roadblock that this sort of solution can't
accommodate. If you want a storefront, get some storefront software.
Chances are good that your ISP has several available, which they set
up and maintain.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
P

Peter Goldfield

Jim Thank you,

That would sort it and I think I could do it!
I had great success with the picture - then someone said "frames" and
everything got put on it's head!
By including picture, price and name in a side frame I solved the immediate
problem!

Everybody here is very generous...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top