Solved

How to call an ASP page when a user click a number

Posted on 1998-10-30
8
140 Views
Last Modified: 2010-04-09
 I create a search-result page from an ASP page.

  Instead of just viewing an next and an prev button I
  want to add text like this: "<< 1 2 3 4 5 6 7 8 >>".
  The text is not static and will change according to
  what the user selects.
 
  When the user click one of the numbers I want to things
  to happen automatically:
  1. assign the selected number or "Prev" or "Next" to a
     hidden variable in the form.
  2. submit the form and call the same asp-page

  I'm familiar with using the POST action of a form, but
  when I try to generate buttons (n number) to represent
  the numbers nothing happens. When I just add a number
  as plain text there is not an event-code to manipulate.
 
  Any suggestions???

  I use FrontPage98 and VBScript

Erot/Norway
0
Comment
Question by:erot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 1

Expert Comment

by:rajgn
ID: 1839280
Can you post the code which is generating your buttons?
0
 

Accepted Solution

by:
dkuntz earned 100 total points
ID: 1839281
If you put the text within a <DIV></DIV> tag, that can give you an onClick() event, and you can call the appropriate ASP from there.

Dennis
0
 

Author Comment

by:erot
ID: 1839282
DO you have some example syntax??
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:dkuntz
ID: 1839283
Here's a sample:
<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
   function dostuff() {
      alert("test message")
   }
</SCRIPT>
<DIV onClick="dostuff()">text here</DIV>
</BODY>
</HTML>

Dennis
0
 

Expert Comment

by:dkuntz
ID: 1839284
Here's a sample:
<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
   function dostuff() {
      alert("test message")
   }
</SCRIPT>
<DIV onClick="dostuff()">text here</DIV>
</BODY>
</HTML>

Dennis
0
 

Author Comment

by:erot
ID: 1839285
Two things:
  First.
  I make up the numbers "<< 3 4 5 6 7 >>" dynamically from
  within an asp Page. I don't know what the numbers are but
  they are stored in two variables. firstPage and lastPage.
  to generate the numbers I have to use a loop like this:
  for i = firstPage to lastPage

    <DIV onClick="dostuff( i )"> i </DIV>
 
  next

  this did not work....my syntax is wrong ...will upgrade to
  100 point if you returns right syntaks
 
  second. When I move the pointer over one of the generated
          numbers I would like it to change.. indicating that
          something will happen when you click it.
          Is this possible?
0
 

Expert Comment

by:dkuntz
ID: 1839286
This worked for me:

<SCRIPT LANGUAGE="JavaScript">
      function dostuff(i) {
      document.write (i);
      }
</SCRIPT>

<FORM>
<%for i = 1 to 5%>
<SPAN STYLE="cursor: hand" onClick='dostuff(<%= i%>)'><%= i%></SPAN>            
<%next%>
</FORM>
0
 

Author Comment

by:erot
ID: 1839287
Thanks a lot

Erot/Norway
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question