Link to home
Start Free TrialLog in
Avatar of erot
erot

asked on

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

 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
Avatar of rajgn
rajgn

Can you post the code which is generating your buttons?
ASKER CERTIFIED SOLUTION
Avatar of dkuntz
dkuntz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of erot

ASKER

DO you have some example syntax??
Here's a sample:
<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
   function dostuff() {
      alert("test message")
   }
</SCRIPT>
<DIV onClick="dostuff()">text here</DIV>
</BODY>
</HTML>

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

Dennis
Avatar of erot

ASKER

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?
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>
Avatar of erot

ASKER

Thanks a lot

Erot/Norway