Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Hiding a Submit Button


Message #1 by "Joe Ehrenfeld" <joee@v...> on Wed, 22 Aug 2001 13:38:13
I have a recordset that displays 10 records per page. At the bottom of the 

page is a Submit button. Depending on the data that is retrieved I 

sometimes show checkboxes. When there are no checkboxes to be displayed I 

need to "hide" the submit button. For example, the first page may have 5 

line items with a checkboxe and the last 5 with no checkboxes, therefor I 

show the submit button. When the user clicks on the Next button to display 

the next ten records there are no checkboxes so I need to hide the submit 

button. I'm racking my brain to figure this one out, but have been 

unsuccessful. Any help would be appreciated. Thanks.
Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 22 Aug 2001 13:46:49 +0100
Presumable you are doing some kind of processing to put the check boxes in.

why not have a flag that you set to true if any check boxes are written, and

only write the submit button if the flag is true?



-----Original Message-----

From: Joe Ehrenfeld [mailto:joee@v...]

Sent: 22 August 2001 14:38

To: ASP Web HowTo

Subject: [asp_web_howto] Hiding a Submit Button





I have a recordset that displays 10 records per page. At the bottom of the 

page is a Submit button. Depending on the data that is retrieved I 

sometimes show checkboxes. When there are no checkboxes to be displayed I 

need to "hide" the submit button. For example, the first page may have 5 

line items with a checkboxe and the last 5 with no checkboxes, therefor I 

show the submit button. When the user clicks on the Next button to display 

the next ten records there are no checkboxes so I need to hide the submit 

button. I'm racking my brain to figure this one out, but have been 

unsuccessful. Any help would be appreciated. Thanks.

Message #3 by <taodeny@y...> on Thu, 23 Aug 2001 09:03:20 +0300
You could try using javascript to loop through all controls in the page of

type checkbox. If none is found then you can use a custom stylesheet to hide

the submit button eg.

document.all.item("nameOfSubmitButton").style.visibility="hidden".



T. Odeny








  Return to Index