Solved

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

Posted on 1998-10-30
8
135 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
  • 4
  • 3
8 Comments
 
LVL 1

Expert Comment

by:rajgn
Comment Utility
Can you post the code which is generating your buttons?
0
 

Accepted Solution

by:
dkuntz earned 100 total points
Comment Utility
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
Comment Utility
DO you have some example syntax??
0
 

Expert Comment

by:dkuntz
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Expert Comment

by:dkuntz
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks a lot

Erot/Norway
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
use month from current date as default for select list 3 25
Hover Gone 16 29
FTP File permissions 1 27
Image decoding from Camera 3 42
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now