Web Analytics Made Easy -
StatCounter How can I hide these fields? - CodingForum

Announcement

Collapse
No announcement yet.

How can I hide these fields?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I hide these fields?

    I have the below code I want to hide

    Code:
    <!--TransactionFields section begin-->
    <tr  bgcolor='#ffffff' ><td  colspan=3><b><font  color='#060331' face='Arial' size='2' ><div /></font></b></td></tr>
    <tr  bgcolor='#ffffff' ><td   align=left width=30% colspan=1><font  color='#404040' face='Arial' size='2' >Type:</font></td>
    <td   align=left colspan=2><font  color='#404040' face='Arial' size='2' >
    <select name="Field5139008"  size="1" ><option value="">-- please make a selection --</option>
    <option value="Fast" selected selected="selected">Fast</option>
    <option value="Slow" >Slow</option></select></font></td></tr>
    <tr  bgcolor='#ffffff' ><td   align=left width=30% colspan=1><font  color='#404040' face='Arial' size='2' >Person:</font></td>
    <td   align=left colspan=2><font  color='#404040' face='Arial' size='2' >
    <input type="text" size="40" maxlength="100" name="Field5139009" value="" ></font></td></tr>
    <tr  bgcolor='#ffffff' ><td   align=left width=30% colspan=1><font  color='#404040' face='Arial' size='2' >ID:</font></td>
    <td   align=left colspan=2><font  color='#404040' face='Arial' size='2' >
    <input type="text" size="40" maxlength="" name="Field6088029" value="" ></font></td></tr><tr  bgcolor='#ffffff' >
    <td   align=left width=30% colspan=1><font  color='#404040' face='Arial' size='2' >Name:</font></td>
    <td align=left colspan=2><font  color='#404040' face='Arial' size='2' >
    <input type="text" size="40" maxlength="" name="Field6088028" value="" >
    </font></td></tr>
    <!--TransactionFields section end--></table>
    It displays something like this:
    Type: drop down list
    Person: text box
    ID: textbox
    Name: textbox

    I have the below code
    Code:
    <script type="text/javascript"> 
    $('input[name="Field5139008"]').hide();
    $('input[name="Field5139009"]').hide(); 
    $('input[name="Field6088028"]').hide();  
    $('input[name="Field6088029"]').hide();  
    </script>
    Which changes the display to: (Removes only the 3 text boxes, will not remove the drop down list or the labels)

    Type: drop down list
    Person:
    ID:
    Name:


    How do I remove not just the textboxes but the drop down list and the labels?

  • #2
    How do I remove not just the textboxes but the drop down list and the labels?
    give the table an id and hide the table. or give those table rows a common class and hide that.

    (Removes only the 3 text boxes, will not remove the drop down list or the labels)
    neither labels nor dropdowns are <input> elements ...
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

    Comment


    • #3
      Your HTML is obsolete code - bgcolor, font color and font face were deprecated years ago and are not supported in HTML5. You should be using CSS instead.

      All the code given in this post has been tested and is intended to address the question asked.
      Unless stated otherwise it is not just a demonstration.

      Comment


      • #4
        I am using a custom application where I am not able to modify the HTML code, the code that I provided. All I can do is enter in JavaScript.

        Comment


        • #5
          I figured it out. The below code solved my issue

          Code:
          <script type="text/javascript"> 
          $("font:contains('Type:')").closest('tr').hide(); 	
          $("font:contains('Person:')").closest('tr').hide(); 	
          $("font:contains('ID:')").closest('tr').hide(); 	
          $("font:contains('Name:')").closest('tr').hide(); 	
          </script>

          Comment

          Working...
          X