Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

how to put links (name anchors) in a dynamic generated page

Guest
Jun 07, 2006 Jun 07, 2006

Copy link to clipboard

Copied

I have a page (results.asp) that gets dynamically generated from a db using a DW and MySQL app. The page (a table) looks sometihng like this:

Year Card #
1951 01
1951 02
1951 03
1952 01
1952 02
1953 01
1953 02
1953 03
and so on

I've made the "Year" column a text link and added a Pop-Up Menu behavior so that users could select a year and jump directly to a specific section of the page (table). However, I'm not sure how to put a <a href> name anchor in for each of the years. For instance calling :

<a name="1951">1951</a>

from a declaration of:

<a href="#1951">Go to year 1951</a>

I would want to call each year (1951, 1952...1973) using name anchors. But again, I'm not sure how to put all the named anchors in a document that gets dynamically generated. It is a a table that gets its data generated via a Repeated Region. Hope this question makes sense. Any suggestions/comments appreciated. Thanks.
TOPICS
Server side applications

Views

242
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 07, 2006 Jun 07, 2006

Copy link to clipboard

Copied

If you year card allways follows that format then you could use the
following code on the page.

Outside of the repeat region have this statement

<%
Dim TestYear, CurrentYear, ThisYearCard
TestYear = "0000"
%>

Then in the repeat region where you want the anchor to appear use this code

<%
ThisYearCard = recordset.fields.item("YearCard").value
CurrentYear = Left(ThisYearCard, 4)
If TestYear <> CurrentYear then
response.write("A name='") & CurrentYear & "'>"
TestYear = CurrentYear
End if
%>

Where you want the Year card to appear you would then use <%=ThisYearCard%>
rather than the recordset element.



--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"obcbeatle" <webforumsuser@macromedia.com> wrote in message
news:e67pg5$rp0$1@forums.macromedia.com...
>I have a page (results.asp) that gets dynamically generated from a db using
>a
> DW and MySQL app. The page (a table) looks sometihng like this:
>
> Year Card #
> 1951 01
> 1951 02
> 1951 03
> 1952 01
> 1952 02
> 1953 01
> 1953 02
> 1953 03
> and so on
>
> I've made the "Year" column a text link and added a Pop-Up Menu behavior
> so
> that users could select a year and jump directly to a specific section of
> the
> page (table). However, I'm not sure how to put a <a href> name anchor in
> for
> each of the years. For instance calling :
>
> <a name="1951">1951</a>
>
> from a declaration of:
>
> <a href="#1951">Go to year 1951</a>
>
> I would want to call each year (1951, 1952...1973) using name anchors.
> But
> again, I'm not sure how to put all the named anchors in a document that
> gets
> dynamically generated. It is a a table that gets its data generated via a
> Repeated Region. Hope this question makes sense. Any
> suggestions/comments
> appreciated. Thanks.
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 08, 2006 Jun 08, 2006

Copy link to clipboard

Copied

LATEST
Thanks for the reply! I'll keep it for future reference, however, I just realised today that my logic was flawed on creating a pop-up menu link on my results.asp page. My results.ap page displays data in a table based on a category value passed by a form variable. Thus, results.asp renders 'year' and 'card #' based on more than one category of card type (baseball. football, etc.) which in turn is based on what is selected by the user. As a consequence, the pop-up menu link shows up on all data result categories other than those it was designed for. Hope that made sense. Anyway, I need to figure out a different way to allow users to be able to move to different sections of the page for only ONE category (baseball) where the data results are rather lengthy compared to other categories (football...). Thanks again for your suggestion. I may be able to use it for a different app.!

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines