link target question

D

don

I'm trying to have a link to a page open up to a specific spot on the same
page - I'm familiar with

<a href = "Purchase.html" target = "new window"> Buy Product </a>

but my code needs to do this

<a href = "Purchase.html" target = "buybox"> Buy Product </a>


and then down a few lines I have

<div class = "buybox" name = "buybox">this is the result box</div>
 
M

Mark Parnell

Previously in alt.html said:
here is a pic of what I'm trying to do

This is a plain text newsgroup - please don't post binary. If you want
to show an example, post a link.
I'd like the links on the left to
open up in the white box

It sounds like rather than linking to another part of the page, you
actually want to insert/replace part of the content of the page. There
are basically 2 ways of doing this:

1) Reload the page, using server-side script to insert the additional
content.

2) Use client-side script to insert/display the additional content.

1 is preferred, but requires server-side scripting of some sort
(whatever flavour you prefer/have available). 2 doesn't require any
server-side scripting to be available on the server, and will generally
be quicker, but won't work at all for visitors with scripting
disabled/unavailable.
 
L

Leif K-Brooks

Mark said:
It sounds like rather than linking to another part of the page, you
actually want to insert/replace part of the content of the page. There
are basically 2 ways of doing this:

1) Reload the page, using server-side script to insert the additional
content.

2) Use client-side script to insert/display the additional content.

FWIW, you'll be able to do this with pure CSS when browser support for
CSS3 becomes a bit better. Example:
<http://tw.ecritters.biz/html_examples/fragment_hide/>.
 
M

Mark Parnell

Previously in alt.html said:
1) Reload the page, using server-side script to insert the additional
content.

don said:
what would this link line look like?

OTTOMH, something along these lines:

<a href="purchase.php?action=buy">buy</a>
....
<div>
<?php if ($_GET['action'] == 'buy') then {
echo("<p>Buy stuff, or whatever you want to show here</p>");
} ?>
</div>

BTW: In future, please reply to the group, so everyone gets the benefit
of any replies.
 
D

don

Well - I'm writing the php code now to insert the second html page right
back into the first page, but my next question is if the second page has
another submit button, how do I deal with two submit buttons? The second
page is going to be a <form> for the user to submit and get processed by a
third page......

Mark Parnell said:
Previously in alt.html said:
1) Reload the page, using server-side script to insert the additional
content.

don said:
what would this link line look like?

OTTOMH, something along these lines:

<a href="purchase.php?action=buy">buy</a>
...
<div>
<?php if ($_GET['action'] == 'buy') then {
echo("<p>Buy stuff, or whatever you want to show here</p>");
} ?>
</div>

BTW: In future, please reply to the group, so everyone gets the benefit
of any replies.
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top