0
I have a form that registers Clients, and has the option of being an Individual or Legal Person, and each one has some different fields.
I thought of using a @Html.Radiobutton with the option Individual and Legal Entity. When there was a click on one of the options appears the respective fields.
How do I do that?
The way would be using jQuery. Want an answer in jQuery?
– Leonel Sanches da Silva
Hello to you do this with the minimum headache, the most correct is to use Javascript to make a visual control to show and hide the form fields. If you were to do it directly in Razor (the language of the @Html view.Something) it would take work because the two options would be either give a post in the form and return itself with different fields, or use an Updatepanel that for this case I think is bullshit. But the most used standard (you can check on many sites that have registrations) is to have both Forms, natural and legal person, and your radiobutton only enables the right form
– Erick Gallani
Suggestion, if possible avoid the use of javascript, declare the 2 menus as Visible false , and when selected on radiobuttom , checkbox, put true Visible for the same.
– P.Rocha