0

How do I modify the below code to hide all fields except the ones needed to be shown? Have 20 more fields do not one to name them one by one to hide.

   $(document).ready(function() {
$('nobr:contains("stuff1")').closest('tr').show();
$('nobr:contains("stuff2")').closest('tr').show();
//Hide the rest of the fields without mentioning their names

2 Answers 2

0

Hide all the fields using CSS display:none and enable the ones you need using JQuery.

2
  • JQuery is not enabling the fields...believe the CSS is blocking all the fields...anyway to get around this? How do I trigger CSS first and then JQuery?
    – John D
    Commented Oct 18, 2016 at 21:22
  • CSS should always execute first. Place any <link> elements above any <script> elements in the <head>.
    – IE5Master
    Commented Nov 15, 2016 at 15:45
0

For anyone who is wondering what I did...I ended up just hiding each field that needs to hidden.

0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.