How I can navigate to different pages from a single page using different buttons?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Safeer Ali
    New Member
    • Sep 2010
    • 1

    #1

    How I can navigate to different pages from a single page using different buttons?

    I have a web page in php. I put two buttons in the form on the page. Now the problem is that I want to navigate into different pages , but i cant. The buttons are say submit and back. if I pressed submit i want to go to reg.php or if I pressed back, i want to goto home.php. How can i do this?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Ask the Javascript guys.

    Comment

    • JKing
      Recognized Expert Top Contributor
      • Jun 2007
      • 1206

      #3
      Make your buttons links.

      Comment

      • kovik
        Recognized Expert Top Contributor
        • Jun 2007
        • 1044

        #4
        If these buttons are related to a form, the submit button should just be a regular submit button and the back button (which I personally call a "cancel" button) should be an anchor.

        If the action attribute of your form element is "reg.php", then hitting submit will send your user to reg.php. If the href attribute of your anchor element is "home.php", clicking it will send your user to home.php.


        But like I said, the cancel button shouldn't be a button. Don't send a button in to do a link's job.

        Comment

        Working...