Click Button to the next page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divina11
    New Member
    • Aug 2007
    • 55

    Click Button to the next page

    I'm new to HTML and currently building a website, I'm trying to click on a button to take me to page2.htm, However it's not working:

    Please see my code below:


    [HTML]<html>
    <head>
    </head>

    <body>

    <h3>Test Divina Dummy Site<h3>
    <br>

    <input type="button" name="next" id="next" value="Next" onClick="page2. htm">


    </body>
    </html>[/HTML]
  • Screaming Eagle
    New Member
    • Aug 2007
    • 4

    #2
    Hello,
    I'm sort of new to programming, myself, but right off I noticed that your input is not surrounded by form tags. It should look like this:
    Code:
    <form action="">
    <input type="button" value="userdefined" name="userdefined id="userdefined" onclick="userdefined/>
    </form>

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      This is a javascript problem so I'll send you to the javascript board.

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        hi ...

        try something like this :)

        [CODE=javascript]
        function goto_page(src) {
        window.location = src;
        }
        [/CODE]
        and in your html:

        Code:
        onClick="goto_page('page2.htm');"
        kind regards

        Comment

        • divina11
          New Member
          • Aug 2007
          • 55

          #5
          Thank you for that, all resolved now.

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            hi ...

            glad to hear you got it working :) ... post to the forum anytime you have more questions ...

            kind regards

            Comment

            Working...