I have two radio buttons 'yes' and 'no'.If 'no' if picked i should not allow the user to enter into a text field.If the user picks 'yes' then he can enter the details in the text field.
How can i do it,without reloading the page.
Make your text field hidden, then display it when 'yes' is clicked - also add a hide action to the no button in case the user changes their mind after clicking yes. Ahhhhh, I see you have a machine that goes Bing!
I would prefer to have the field disabled or read only and then enable field or remove read only on Yes click.
onClick="txtfieldname.disabled=true;" /false
onClick="txtfieldname.readonly=true;" /false
I'll go along with that - the only reason I hide my textboxes is because I keep getting people complaining that they can't fill it in, even though they haven't clicked yes.....doh! Ahhhhh, I see you have a machine that goes Bing!
That's why I tend to use disabled rather than readonly. At least then it looks like you shouldn't be able to do anything with it. I guess that doesn't stop some users though.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.