This discussion is archived
1 Reply Latest reply: Mar 4, 2013 11:45 PM by 655964 RSS

Enable text box in tabular form

A.MohammedRafi Newbie
Currently Being Moderated
Hi,

I have a radio button which has two values (Yes/No) once the value is selected as Yes I need to enable a text box else it should be disabled

Please let me know how to achieve this ?

Thanks
  • 1. Re: Enable text box in tabular form
    655964 Newbie
    Currently Being Moderated
    I'm think you may need to create some fancy custom jquery work here. The magic is that jquery is not just for manipulating style programatically. Once jquery has an HTML DOM node in hand, it can programatically manipulate its program!

    Take a look at the rendered HTML source of your tabular form. You will first need to determine the proper jquery selector that will return the list of all the HTML elements that are the mutual parent to the radio control and the target textbox.
    Now, in a jquery on-document-ready callback function, you would use that selector you determined to register a another call back function ("toggleTextBox(elementID)" lets say) with each of the radio controls' onchange events, and that callback function would perform the actual enable/disable or hide/reveal or whatever when called.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points