473,388 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Static date field in form when form is opened at later date.

17
I need to enter a date into a text field when form is loaded. However I need this date to be static when the form is opened at a later date.
I have the text box set to readonly. Will this be sufficient or do I need some type of Update function for when the form is opened again?


[HTML]<script language="javascript">

window.onload = function (){
var tDay = new Date();
tMonth = tDay.getMonth()+1;
tDate = tDay.getDate();
if ( tMonth < 10) tMonth = "0"+tMonth;
if ( tDate < 10) tDate = "0"+tDate;
document.getElementById("OBKey__131_1").value = tMonth+"/"+tDate+"/"+tDay.getFullYear();
}

<input type="text" name="OBKey__131_1" size="10" maxlength="10" tabindex="1" readonly="readonly">[/HTML]
Mar 17 '08 #1
3 1804
gits
5,390 Expert Mod 4TB
with that code you will always set the value of the inputfield to the current date when the page is loaded ... if that is what you want? ... so please explain in more detail what you mean with 'static' und 'later date' ...

kind regards
Mar 17 '08 #2
Alexio
17
When the form is first filled out by user, the current date is enter dynamically into the date textbox. The form is then saved into the database. When user goes back to open form after a few days, I need the original date to be in the text field not the new current date. So I need the original date to be "static".
Mar 17 '08 #3
gits
5,390 Expert Mod 4TB
so you have to retrieve the date from the database ... probably the user has to provide some identification or you may use cookies to store some data at the client ... you cannot just do that only with javascript ...

kind regards
Mar 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Adrian Parker | last post by:
Hi. I have a date time picker in my program which uses ADO to read from an Access database. It works perfectly, unless the database is empty (no records) when opened. When you try to open an...
1
by: glenn | last post by:
Hi folks, I am using an Access database, VB.NET and ADO.NET working with a DataGrid control. MY datagrid table has both a date_sent and a date_ans field. When I Insert a record in my SQL...
1
by: Stephen D Cook | last post by:
I have a search form with a query-linked subform. One of the fields in the subform are date fields. Is there a way to autopopulate the DateFilled field when the person enters the field? I need...
7
by: Morgan Cheng | last post by:
In the book *Programming C#* 4th editionby Jesse Liberty, it reads "Actually, the CLR guarantees to start running the static constructor before anything else is done with your class. However, it...
4
mmect
by: mmect | last post by:
I'm working on a very basic form and need to know how to add a current date to a field (modified_recommendation) when another field is changed (recommendation). Please let know how i can do this. ...
8
by: Trev | last post by:
Hi Can anyone point me in the right direction here, I would like to open a table in access 2003 by date. I have an asp web page which needs to read data from a table with each days today's date...
28
Ericks
by: Ericks | last post by:
I want to highlight new data that has been entered in my database since a last meeting so it is easy to see in a subform’s table what info is new. In my database I have a table called...
1
by: tmcjunkin | last post by:
I'm trying to back into this project by defining what the user needs to see when they open a form. I'm between beginner and intermediate with vba, but have been using access for years. When the...
6
by: awojciehowski | last post by:
I am working with a database now and need some guidance. I am attempting to input an auto calculation. I have the ability to enter a date in a text box on a form. I want to be able to have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.