Regarding having multiple links on a page

Results 1 to 2 of 2

Thread: Regarding having multiple links on a page

  1. #1
    Join Date
    Dec 1969

    Default Regarding having multiple links on a page

    Hi..I have a few buttons linking to different pages.I try writing something like this for one of the button but couldnt work.How do i correct that?<BR><BR>&#060;input type="button" value="view" onclick="view.jsp"&#062;

  2. #2
    Join Date
    Dec 1969

    Default How do your other buttons... it? Or don&#039;t they work either?<BR><BR>The problem is you onclick event handler. You have to write JavaScript code into it and not the name of a JSP file with code:<BR><BR>&#060;input ... onClick="alert(&#039;Hello World&#039;);"&#062;<BR><BR>If you want to include a JSP file on your page, you need to do &#060;script src="view.jsp"&#062; and then call the code you have in there from the &#060;input&#062; tag. You have to make sure that the code is in a function so you can call it:<BR><BR>view.jsp:<BR><BR>function helloWorld() {<BR>alert("Hello World");<BR>}<BR><BR>In your ASP/HTML page:<BR><BR>&#060;input ... onClick="helloWorld();"&#062;<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts