www.webdeveloper.com
Results 1 to 5 of 5

Thread: Form links and IE9 and IE10

  1. #1
    Join Date
    Aug 2013
    Posts
    6

    Form links and IE9 and IE10

    I've developed a web application that uses a number of hypertext links. Links from buttons in a form element do not work in IE9 and IE10, but they do work correctly in Google Chrome, Firefox, Opera and Safari. Links in html outside of forms work correctly. I'm new to web development. Any help would be greatly appreciated. Thanks.

  2. #2
    Join Date
    Mar 2011
    Posts
    1,110
    It's impossible to help without seeing the code. Post it here or post a link to it.
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Aug 2013
    Posts
    6
    Quote Originally Posted by rtrethewey View Post
    It's impossible to help without seeing the code. Post it here or post a link to it.
    Thanks for replying. I've created a test program that illustrates the problem which is posted below. When I click on the 'Go to test page from form' button in IE nothing happens.

    <!DOCTYPE html>
    <?php
    if (isset($_POST['lastname'])) {
    print("Last name = ". $_POST['lastname']);
    }
    ?>
    <html>
    <head>
    <title>Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
    <br>
    <form action="demomain.php" method="post">
    Enter lastname: <input type="text" name="lastname">
    <input type="submit" name="submit" value="Submit"><br>
    <br>
    <a href="testpage.php"><button type="button">Go to test page from form</button></a>
    </form>
    <br>
    <a href="testpage.php"><button type="button">Go to test page outside form</button></a>
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <body>
    This is the test page.
    </body>
    </html>

  4. #4
    Join Date
    Mar 2011
    Posts
    1,110
    I suspect that despite the fact that you set the type to 'button', which should remove any default onClick behavior, IE is running into an internal conflict that's overriding the <a>nchor tag. You could try:
    Code:
    <botton><a href='??'>Go to test page</a></button>
    but I think the better solution would be to eliminate the <button> tag and use CSS to style the <a>nchor tag instead.
    Rick Trethewey
    Rainbo Design

  5. #5
    Join Date
    Aug 2013
    Posts
    6
    Thank you so much. Deleting the button tags and putting
    a {
    type: button;
    }

    in a css file did the trick. Works in all 5 browsers now.

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