Discussion Locked

How to control Buttons in web Browser

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I would like to control the Back and Forward button in Webbrowser by setting them sometimes as Disabled and finding the last history.Let me know the way to accomplish this using Jvascript or vbscript

5 replies

by cedric king

Have a script which executes on document's OnLoad event. The script should check that if "history.length" = "0". If it is, it means that there is no Back history, so it should execute another function which toggles the elements between ON and OFF:
function Toggle(objElement)
{
objElement.disabled = (!objElement.disabled)
}

If you are using IE, then that's what you can do. You can't determine if there's Next document in the History list. If you are using Netscape, you can use "history.next" and "history.previous" (which returns you a URL) to determine if you should Disable the Next button.
Hope I understand your problem and solve it.

This discussion is closed to new replies.