www.webdeveloper.com
Results 1 to 7 of 7

Thread: using buttons as link to another page

  1. #1
    Join Date
    Jan 2009
    Location
    Los Angeles
    Posts
    24

    using buttons as link to another page

    Good day,
    I have a "next" button on my html tag. I am trying to use this next button to like to the next page on the same website, but some reason it does not work. Here is my code. I will appreciate all help. if you have a better way of doing this. I will be glad to use that too.

    function Payment()
    { window.location ="http://citywideglobal.com/payment";
    }



    <INPUT TYPE="button" Value="Next" onClick="Payment()"/>

    Thanks

  2. #2
    Join Date
    Apr 2006
    Posts
    493
    Code:
    <form>
    <input 
                               type="button" 
                               value="NEXT" 
                               onclick="location.href='http://www.google.com'" /></form>

  3. #3
    Join Date
    Jan 2009
    Location
    Los Angeles
    Posts
    24
    Thanks skilled1, but I am still not able to display this page
    alobi

  4. #4
    Join Date
    Apr 2006
    Posts
    493
    in your code is your input button inside of a form tag?

    and try replacing your window.location with location.href

    then use the <INPUT TYPE="button" Value="Next" onClick="Payment()"/>

  5. #5
    Join Date
    Jan 2009
    Location
    Los Angeles
    Posts
    24
    Forgive me for not being more explanatory with my last posting and also for my typos. I want to thank you too for taking time to make a sense out of what I was trying to say, thanks. Here is a more detailed Posting.
    I have a Next button on a form on page X.htm, I am using this button as a link to another page, page Y.htm on the same site www.xyz.com .
    I have the following function and code on the form on page X.htm that is not allowing me to link to page Y.htm, the Next button is also on page X.htm
    The function:
    <script language=”JavaScript”>
    Function ()
    { location.href=http://www.Y.htm/
    }

    The code
    <INPUT TYPE="button" Value="Next" onClick=" NextButton()"/>

    Please see if this will help you understand my problem.

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Good Lord, Why are you using JavaScript for this? It'll fail often enough that you be laughed off the internet. Use instead:
    Code:
    <form action="next-page.html" method="get">
    <div><button type="submit">Next</button></div>
    </form>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  7. #7
    Join Date
    Jan 2009
    Location
    Los Angeles
    Posts
    24
    Thank you very much the code did the job.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles