Click to See Complete Forum and Search --> : onclick problem


cangolfer
11-26-2002, 01:26 PM
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

Charles
11-26-2002, 04:17 PM
<!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>

gil davis
11-26-2002, 04:22 PM
... onClick="window.location='here.html'" ...

Charles
11-26-2002, 04:35 PM
But that will not work for the 12% or so of users who eschew JavaScript.

gil davis
11-27-2002, 06:15 AM
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? ;-}

Charles
11-27-2002, 06:22 AM
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.

gil davis
11-27-2002, 06:46 AM
Good point. But it would have come off better without the arrogant attitude.

cangolfer
11-27-2002, 07:02 AM
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.

:)

Charles
11-27-2002, 09:15 AM
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.

mbrydge
11-27-2002, 10:31 AM
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)">