Picture in form?

  • Thread starter Peter Goldfield
  • Start date
P

Peter Goldfield

I have a great number of pages each with a different picture. I link through
to the same form from each page and would like to "include" the picture from
the page to the form - a different picture from each page!!

Can anyone help - is there a sort of "include picture from last page"
button? Seriously.....

Many thanks
 
C

chris leeds

do you want the actual picture to show up on the face of the form or just a
reference to the picture?
I know there's a way because I just finished doing something very similar.
(telling a single page which of 35 different sets of pictures and
accompanying text to display. http://nedp.net/aycock/asp/ surprisingly
easy. can you run asp pages? if you could give a little better idea of
what you're trying to do it'd help.
 
T

Thomas A. Rowe

You might be able to do this with JavaScript, I don't know.

However I can be done with a server-side script such as ASP, PHP, etc., but
you will then have to process the form with a custom form handler and not
via FP Form Handler.

--

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

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

Jon

Hi Peter,
something along these lines
<script type="text/javascript">
document.write('<a href="FormPage.htm?' + document.images['img'].src
+'">Form Page</a>')
</script>
<img src="YourPicture.gif" name="img">
and then on FormPage.htm
<script type="text/javascript">
if(location.href.indexOf("?")>-1){
a = location.href.split("?");
document.write('<img src="' + a[0] + '">')
}
</script>

Jon
Microsoft MVP - FP
 
J

Jim Buyens

-----Original Message-----
I have a great number of pages each with a different
picture. I link through to the same form from each page
and would like to "include" the picture from the page to
the form - a different picture from each page!!

Can anyone help - is there a sort of "include picture
from last page" button? Seriously.....

Add this script to the <head> section of your forms page:

<script>
function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] = unescape(qvbl[1].replace
("+"," "));
}
}
}
function getqsvar(qsvar){
if (qstr[qsvar] == null){
return "";
}else{
return qstr[qsvar];
}
}
var qstr = new qsobj();
</script>

Then, add this code where you want the picture to appear.

<script>
document.write('<img src="' + getqsvar("pic") + '">');
</script>

Then (and here comes the stinky part) modify each URL
that points to your forms page so it specifies a query
string value as shown below.

<a href="myformspage.htm?pic=pethippo.jpg">

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)
|/---------------------------------------------------
*----------------------------------------------------
 
J

Jon

sorry, this
document.write('<img src="' + a[0] + '">')
should be
document.write('<img src="' + a[1] + '">')

Jon

Jon said:
Hi Peter,
something along these lines
<script type="text/javascript">
document.write('<a href="FormPage.htm?' + document.images['img'].src
+'">Form Page</a>')
</script>
<img src="YourPicture.gif" name="img">
and then on FormPage.htm
<script type="text/javascript">
if(location.href.indexOf("?")>-1){
a = location.href.split("?");
document.write('<img src="' + a[0] + '">')
}
</script>

Jon
Microsoft MVP - FP


Peter Goldfield said:
I have a great number of pages each with a different picture. I link through
to the same form from each page and would like to "include" the picture from
the page to the form - a different picture from each page!!

Can anyone help - is there a sort of "include picture from last page"
button? Seriously.....

Many thanks
 
P

Peter Goldfield

Wow - thanks everyone! I suppose I'll have a go when I pluck up courage -
gie us a button soon - pretty please.....
 
P

Peter Goldfield

Thanks very much Jim - it all looks a bit stinky!
1.When you say "add this code where you want the picture to appear" - I'm
used to clicking on a page and clicking "insert picture" - how does one know
where "want" is?
2. can I modify the URL in the "hyperlink properties" or do I have to find
it in HTML?
3. Just realised my pictures will be a bit big! Can I add bit to scale them
(and resample) to say 25% (still dreaming of a button!)

cheers...
 
J

Jim Buyens

Peter Goldfield said:
Thanks very much Jim - it all looks a bit stinky!
1.When you say "add this code where you want the picture to appear" - I'm
used to clicking on a page and clicking "insert picture" - how does one know
where "want" is?

1. Type xxx where you want the picture to appear.
2. Select the xxx you just typed.
3. Click the HTML tab (or, in FP2003, the Code tab)
at the bottom of the editing window.
4. The xxx will also be highlighted in HTML (or Code) view.
Replace it with:
<script>
document.write('<img src="' + getqsvar("pic") + '">');
2. can I modify the URL in the "hyperlink properties" or do I have to find
it in HTML?

Yes, you can do it in Hyperlink Properties.

1. Right-click the picture or text you want to hyperlink,
and choose Hyperlink from the shortcut menu.
2. Make sure myformspage.htm (or whatever) appears in the Address box.
3. Click the Parameters button, then the Add button.
4. In the Name field, type: pic
5. In the Value field, type: pethippo.jpg (or whatever).
6. Click OK, OK, OK.
3. Just realised my pictures will be a bit big! Can I add bit to scale them
(and resample) to say 25% (still dreaming of a button!)

This one is tougher. If you have a copy of Microsoft Office FrontPage
2003 Inside Out or Web Database Development Step by Step .NET Edition,
and if your host supports the .NET Framework, then the book's CD
contains an ASP.NET page named picsizer.aspx that does what you want.
Basically, you code an <img> tag like this:

<img src="picsizer.aspx?url=../images/clown.jpg&size=75">

and the Web server will always send a version of the picture whose
longest side is 75 pixels. You can see this page in action at:

http://www.interlacken.com/fp11extras/picsizer/default.htm

or at

http://www.interlacken.com/fp11extras/piclib/default.aspx

This second link works like a photo gallery, but it gets the list of
pictures to display in real-time, by reading the contents of a folder
on the Web server. The picsizer.aspx page generates the thumbnails on
the fly.

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)
|/---------------------------------------------------
*----------------------------------------------------
 
C

chris leeds

Oh, sure! now you tell me and all I got from Cheshire was that clip library
utility.
;-)
 
J

Jim Buyens

Glad to be of service!

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)
|/---------------------------------------------------
*----------------------------------------------------
 
Top