+ 10
How to keep the HTML text field hidden until a condition is met, e.g until the selection of a radio button.
I want to display a text field based on the selection of the radio button by the user. I know how to do it using AJAX, but I don't want to do it that way. So is there any other way?
5 odpowiedzi
+ 6
You can do this in many ways. The most simple one would be to use Javascript to alter the css for the text, or you could do this by using DOM-events. I would recommend doing this with DOM-events because it gives a better structure. What you need to do is give some blank text either a class or an ID, and then use javascript to check which button is selected. Then simply change the blank text to whatever you want.
+ 18
in asp.net
set textbox visibility false
and then code section
if(radiobutton1.checked)
{
textbox1.visible="true";
textbox1.text="sololearn is awesome";
}
+ 9
The problem is I don't know Jquery. So I found using JavaScript to alter css more suitable for me.
Thanks everyone for answering.
+ 4
Use jQuery, is simple and clean
$( ".target" ).hide();
$( ".target" ).show();
+ 3
use jQuery instead.