Sunday, May 10, 2009

How to enable/ disable functions and hide or show visibility in asp?

I am using ASP ver. 3 and would like to know how to code my radio buttons to show or hide some text fields. I would also like to enable or disable form options.





If anyone knows how to write this code, it will be greatly appreciated.

How to enable/ disable functions and hide or show visibility in asp?
Well the ability to actually hide and show elements of a form to the user is done through javascript and manipulating their CSS values. This isn't something that ASP directly manipulates. It can show elements and such based on an if statement though like if someone selected a checkbox to show the username field and then hits submit, the next page can detect that they checked this field and run something like ...





if request.form("enableusername") = "usernamefield" then


response.write "%26lt;input type='text' name='username' size='30'/%26gt;"


end if





But like I said, if you are looking for them to just click a button and it suddenly show a field, that is done through javascript. Look at altering its CSS properties.





Hope that helps. The page below shows a thread where they provide a toggle function for toggling the elements.


No comments:

Post a Comment