?
Solved

Insert a date in a table in an ASP page

Posted on 2014-02-12
5
Medium Priority
?
455 Views
Last Modified: 2014-02-17
I have a web page that is in asp format. It is a simple list  that the names are linked to some folders on a file share. what I would like to do is add another column to the table so out beside each folder name I could insert a date of when the documents need to be reviewed within that folder and a checkbox so when the review happens the owner could click the review box and it would reset the dat out to the next interval so for instance if the date is today and they click the box it will change to be Feb. 12, 2016 is the review frequency is 2 years. is this possible.  I guess I also need to ensure only the person i assign could clikc the button but I think I can handle that by pulling the AD information when they open the webpage but I would only want the checkbox to be visible if it was the person assigned. so for instance we use numbers to identify users here so I only want user 4321 to see the checkbox.
0
Comment
Question by:jlcannon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39854988
I'm not sure what your real question is.  Perhaps post the code you are using and explain where you are stuck.

You can add dates with dateAdd http://www.w3schools.com/vbscript/func_dateadd.asp

theDate = "2/12/2014"
newDAte=dateadd("yyyy",2,theDate) ' = 2/12/2016

Open in new window


LoggedInUser="1234"
theFile =rs("Files") '  /folder/folder/file.pdf
FileOnwer=rs("FileOwner") ' 1234
if cstr(trim(LoggedInUser))=cstr(trim(FileOwner)) then
   response.write theFile& " <input type=""checkbox"">Checkox Info"
end if

Open in new window

0
 

Author Comment

by:jlcannon
ID: 39857324
I dont have any code yet but what I know how to do is validate who is on the website by using the active directory look-up and what I am needing to know is if it is possible to based on who is on the website, make a checkbox show or be grayed out and 2 insert a date of 1 year from the date I post the link to the paper and upon that one year if they do not go in and check that it has been reviewed the date will turn red or something similar but if they do go in and review the paper and check the checkbox it will automatically make the date 1 year from the date they check the box.
0
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39857454
>is possible to based on who is on the website, make a checkbox show or be grayed out
Yes, I have the code above and will paste it below.  

You will check who the logged in user is by assigning a variable LoggedInUser.
Below is an option to test if the logged in owner matches something.  In this case a recordset with field name FileOwner.
LoggedInUser="1234"
theFile =rs("Files") '  /folder/folder/file.pdf
FileOnwer=rs("FileOwner") ' 1234
if cstr(trim(LoggedInUser))=cstr(trim(FileOwner)) then
   response.write theFile& " <input type=""checkbox"">Checkox Info"
end if

Open in new window

If you have a list of files you could test that as well.  

An html checkbox "greyed out" is disabled. It looks like this
<input type="checkbox" value="1234" disabled>1234

Open in new window

In asp
response.write "<input type=""checkbox"" value=""1234"" disabled>1234"

Open in new window

or
<input type="checkbox" value="1234" <% if something="no" then response.write " disabled" end if%>>1234

Open in new window


>automatically make the date 1 year from the date they check
This is dateAdd.  "yyyy" means ad a year, the 1 is the amount of time and the last part is the starting date.  In this case, a variable.
theDate = "2/12/2014"
newDAte=dateadd("yyyy",1,theDate) ' = 2/12/2016

Open in new window

0
 

Author Comment

by:jlcannon
ID: 39859146
Thank you and I will try this once I am back infront of my development computer which will be monday.
0
 

Author Closing Comment

by:jlcannon
ID: 39864839
This is what I was looking for, thank you.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question