www.webdeveloper.com
Results 1 to 10 of 10

Thread: onclick problem

  1. #1
    Join Date
    Nov 2002
    Posts
    5

    onclick problem

    This is a simple one, I know, but I'm having a mind freeze.

    I have a form with 4 buttons (type=button). If I click on 1, I go to here.html, if I click on 2, I want to go to there.html ... and so on.

    HOW?

    thanks in advance

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Button Example</title>
    <form action="http://www.w3.org/TR/REC-CSS1">
    <div><input type="submit" value="1"></div>
    </form>
    <form action="http://www.w3.org/TR/REC-CSS2">
    <div><input type="submit" value="2"></div>
    </form>
    <form action="http://www.w3.org/Style/CSS/current-work/">
    <div><input type="submit" value="3"></div>
    </form>

  3. #3
    Join Date
    Nov 2002
    Posts
    4,473
    Code:
    ... onClick="window.location='here.html'" ...

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    But that will not work for the 12% or so of users who eschew JavaScript.

  5. #5
    Join Date
    Nov 2002
    Posts
    4,473
    Originally posted by Charles
    But that will not work for the 12% or so of users who eschew JavaScript.
    Yeah, but this *is* a JavaScript froum, eh? ;-}

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    True, but that doesn't mean that we ought not to suggest the better solution if that solution does not use JavaScript. And it doesn't mean that the task of this board is to try to make pages as inaccessible as possible. The trick is to use JavaScript along with HTML and CGI scripts so that everything always runs smoothly.

  7. #7
    Join Date
    Nov 2002
    Posts
    4,473
    Good point. But it would have come off better without the arrogant attitude.

  8. #8
    Join Date
    Nov 2002
    Posts
    5

    Thumbs up

    What a spirited discussion. Thank you to all. Gil Davis with onClick="window.location='here.html'" worked well.

    The javascript issue is a non-issue because we force the users to turn on javascript for this internal application.


  9. #9
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Yes, the rules are a little bit different with an intranet. However, some laws still apply. As I understand the Law, if this is for an employer of more than a certain number of individuals or for educational purposes then you must make sure that the page works without JavaScript. But I'm no lawyer so please consult one who specializes in accessibility law before using the JavaScript method.

  10. #10
    Join Date
    Nov 2002
    Posts
    4

    Question OnClick

    I'm trying to implement the cursor changing to the wait(hourglass) cursor on click of the update button while the next page is loading. I can get the hourglass to change on click - from Zachs code in html - but how do I get it to change back to the regular cursor when the new page loads or when the user returns to the other page?

    Here is the code for the button click.

    <input type = "button" name="Update" value="Update" onclick="UpdateObject(this.form)">

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