Reputation: 65
So I am creating MVC project using razor view engine. I have a textbox and a radiobutton. I want to hide text box on form load and show it only on clicking radiobutton. I can achieve later part using jquery.
How can I hide the textbox when view loads? I know in webforms you can do it using eventhandler or by setting Visibility=false.
Here is my sample code
Upvotes: 0
Views: 1833
Reputation: 131
Just use jQuery to hide it in the first place as well.
$(document).ready(function(){
$("#element").hide();
});
Upvotes: 1