0

I am facing a situation where a there is a table row with a from element (Radio Button) in it. This table row doesn't have id or class so that I could hide it. (Table is generated at server end with no access.)

I wanted to know if we can hide a table row based on the value of a from element which is inside this table row.

Can I hide this row (TR) by using the VALUE Custom_03 of Radio Button?

Note: I cannot use Field_39 in this case because here it's a group radio buttons. So, I have to go with the VALUE of the element.

<tr valign="top" style="width: 400px; ">
<td style="width: 400px; ">
<input id="FIELD_39" type="radio" checked="" name="FIELD_39" value="Custom_03">
<span>Envelopes: £ 0.00</span>
</td>
</tr>
7
  • When you want to hide table row? based on value or what? Commented Aug 29, 2014 at 10:32
  • What's a "from element"? Do you mean "form element"? Commented Aug 29, 2014 at 10:34
  • Yes @Sadikhasan want to hide table row based on VALUE or the input field. Commented Aug 29, 2014 at 10:34
  • $('#FIELD_39').closest('tr').hide() ? Commented Aug 29, 2014 at 10:35
  • @Barmar From element can be Radio Button, Text Box or any other form elements. Commented Aug 29, 2014 at 10:35

1 Answer 1

1

You can use jQuery DOM traversal methods to find the <tr> that contains the radio button.

$(":radio[value=Custom_03]").closest("tr").hide();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.