Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide a table if not all values in

Status
Not open for further replies.

stpmtp

MIS
Jan 6, 2006
67
US
hello,

I was wondering if somebody could help me out. I have a table, and I am going to be entering data into it. I would like for none of the data to show if the table is not complete and for the data to show if the table is complete. Could anybody give me a hand with this?

Thanks in advance

Code:
<table width="200" border="1">
  <tr>
    <td>ID</td>
    <td>Record</td>
  </tr>
  <tr>
    <td>1</td>
    <td>1</td>
  </tr>
  <tr>
    <td>2</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>3</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>4</td>
    <td>&nbsp;</td>
  </tr>
</table>
 
Do you want to hide each row, or the entire table? I'm assuming you want to hide rows 2,3, and 4 in your example.

This would be best done using your ASP, PHP, or .NET, whatever scripting language you are using. I'll highlight ASP for you:
Code:
<table width="200" border="1">
<%
    While (Not rs.EOF)
        If (Len(Trim(rs("record"))) > 0) Then
%>
  <tr>
    <td>ID</td>
    <td>Record</td>
  </tr>
<%
        End If
        rs.MoveNext
    Wend
%>
</table>

Take Care,
Mike
 
This is actually more of a scripting issue, than javascript. So you might want to move the question to the appropriate forum.

Take Care,
Mike
 
I want to hide the whole table, the users are going to enter the data from a form
 
so they will be entering data into a form which will eventually appear in a table on the same page, without refreshing, only when the data is complete?



*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
The user enters the data in a form and then they can go and look at the posted data in a different web page. I am in the process of building all of these
 
If that is the case then I agree with Michael - you should only display the data if you want to display the data. You'll be pulling data from a database. If the data is complete, output the HTML, otherwise output nothing.



*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
You tell us. Are you using a database backend right now? What scripting language are you using?

Take Care,
Mike
 
asp
I just posted the same question in the asp forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top