devxlogo

Hide Unnecessary Navigation Buttons Using DHTML

Hide Unnecessary Navigation Buttons Using DHTML

Hide your navigation buttons using DHTML when you don’t need them. Imagine a page with a databound table on it showing ten rows of data. When you’re at the beginning or end of the table, either the “Previous” or the “Next” button is not needed. The following code shows how to play “peek-a-boo” with the buttons. When you’re at the start of the table the “Previous” button is hidden while the “Next” button is displayed and at the end of the table the “Next” button is hidden while the “Previous” button is displayed.

 Sub SetNavigationDisplay()	'Set display for Previous Button	If miPageNumber = 1 Then		cmdPrevious.style.display = "none"	Else		cmdPrevious.style.display = ""	End If	'Set display for Next Button	If miPageNumber = MaxPage Then		cmdNext.style.display = "none"	Else		cmdNext.style.display = ""	End IfEnd Sub
See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist