• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Need help hiding/disabling text fields on page, based on certain values

Dear fellow Web Developers:

I am working on a web page that is supposed to hide certain elements like drop down lists, text boxes, and radio buttons based on the date value.  What I mean is, I have a table that lists rows that are composed of text fields, drop down lists, radio buttons, etc.  Each row has a date value.  I need to hide all rows that are in the past (i.e. prior to the current date).  I am quite new to web design and javascript and would like to know how to conditionally hide various page elements based on the date value.  Can anyone show me how to do this?

Thanks in advance to all who reply.
0
fsyed
Asked:
fsyed
  • 5
  • 5
1 Solution
 
nanharbisonCommented:
Can you give us the html for a row in your form, if each row is the same, otherwise all of the rows?
0
 
Michel PlungjanIT ExpertCommented:
I suggest you don't generate them on the server
0
 
fsyedAuthor Commented:
My apologies for the delay.  I have provided below the code that I need help with.  The one slight change that I have made which makes this problem a lot easier is that I don't need it dependent on a date value.
<html>
<head>

</head>
<body>
<table>
<tr>
<td><input type="text" name="txtname" id="txtname" value="TextBox1" /></td>
<td><input type="text" name="txtname1" id="txtname1" value="TextBox2" /></td>
</table>


</body>
</html>

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Michel PlungjanIT ExpertCommented:
Ok, you have a table.

now what?
0
 
fsyedAuthor Commented:
I need to know how to hide the row if lets say I had another <td> </td> cell that contained a button.  How would I hide the row altogether?
0
 
Michel PlungjanIT ExpertCommented:
Please be MUCH MORE specific.

You want to hide a row if another row has a cell that contains a button or you want to hide a row when you click a button in another cell?

0
 
Michel PlungjanIT ExpertCommented:
Also can you give the rows IDs or is it ok to just index to the row using the offset from row 0?

<table>
<tr id="row0">
<td><input type="text" name="txtname0" id="txtid0" value="TextBox0" /></td>
<td><input type="text" name="txtname1" id="txtid1" value="TextBox1" /></td>
</tr>
<tr id="row1">
<td><input type="text" name="txtname2" id="txtid2" value="TextBox2" /></td>
<td><input type="text" name="txtname3" id="txtid3" value="TextBox3" /></td>
</tr>
</table>

0
 
fsyedAuthor Commented:
There is no issue with giving rows id's as you in your example.
0
 
fsyedAuthor Commented:
I want to hide a row when you click on a button in another cell.
0
 
Michel PlungjanIT ExpertCommented:
So show the html for that please
0
 
fsyedAuthor Commented:
The code you provided up above was sufficient for what was required.  I apologize for the delay in responding.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now