You need to sign in to do that
Don't have an account?
Sudip Mondal
Visualforce show/hide textbox on checkbox selection
Hi All,
I am new to sfdc and I am trying to achieve something that would be a novice task for most of you.
I have a checkbox in a vf page, now when the checkbox is checked I want to make a textbox visible. And similarly whenever the box will be unchecked, the textboxes must be hidden.
Many thanks in advance in this regard.
I am new to sfdc and I am trying to achieve something that would be a novice task for most of you.
I have a checkbox in a vf page, now when the checkbox is checked I want to make a textbox visible. And similarly whenever the box will be unchecked, the textboxes must be hidden.
Many thanks in advance in this regard.
Try below code
VF page
Controller Mark this as "SOLVED" if your query is answered
Regards,
Bhanu Mahesh
All Answers
Try below code
VF page
Controller Mark this as "SOLVED" if your query is answered
Regards,
Bhanu Mahesh
I am not getting any errors but the result i.e; display of a textbox on the checkbox selection is not working.
The code snippet is working for me.
Try it again
Paste the code you have tried, if possible
Regards,
Bhanu Mahesh
Hey,
The code you shared worked when used in a separate VF page. But when its used within an existing <apex:form> tag, its not returning the result. Apologies, can't post the code in here.
Have put this up as a separate section on our existing VF page to display the inteded output.
Many thanks for your input in this regard. :)
I attempted to use this solution in my already existing VF page. It didn't work. Then I started narrowing it down to a text box's attribute: required=true. If I take this attribute off, it works. Else it fails. I am using a standard Account controller with an extension class. The text box is for city which in my requirement is a required field. Any help is greatly appreciated!