473,602 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

17 New Member
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="javas cript">

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.getEle mentById("OBKey __131_1").value = tMonth+"/"+tDate+"/"+tDay.getFullY ear();
}

<input type="text" name="OBKey__13 1_1" size="10" maxlength="10" tabindex="1" readonly="reado nly">[/HTML]
Mar 17 '08 #1
3 1830
gits
5,390 Recognized Expert Moderator Expert
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 New Member
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 Recognized Expert Moderator Expert
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
7093
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 empty database, the date time picker returns error 545. Any attempts to progmatically add new records after the empty database has been opened returns, or to use the DTP and set a new date for those added records, "Field not updateable, Bound...
1
3080
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 statement, I insert a date_sent but I need to insert a blank date_ans field. date_sent is the date when a question was sent to a group from a web form and date_ans is the date when a question was answered.
1
4259
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 this to be code which is entered into the form, rather than as a property of the field in the table because there is other data which is entered before. This data is entered in at a later date.
7
2140
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 only guarantees to *start* running the static constructor; it doesn't actually guarantee to *finish* running it." Page 82, Chap 4 Classes and Objects. If it is true, then it is possible that some static fields are not initialized (by static...
4
3420
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. Currenltly, I have the following code in my database (OnCurrent and AfterUpdate)...the problem i'm having is that the date gets populated after the records is opened + when the code's in the Afterupdate part of the recommendation field, it does work....
8
2418
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 (which ever day that is) then a new table is created with today's date. Example: I have a table called 17-may-2007 my ASP page reads this table for 24hours then tomorrow (12:00 midnight 18th) I will have a new table called 18-may-2007 and the...
28
2875
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 CompoundsObservations and that contains a date field called DateOfInfoAdded. There is another table called LastMeetingDate with only one field, a date field called LastMeeting. This table only serves the purpose to register the last meeting's date and should be...
1
2582
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 user opens the form they need to see the resident's current balance. The balance includes: Previous balance (which I can just pull in) Current rent (which needs to be based on the date the form is opened) Late fees (which needs to be based on...
6
12417
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 another field that auto calcuates 90 days later and simiply displays that date. The auto calculated date does NOT have to be assiocated with a field in any table, just a caculation in what I believe would be referred to an unbounded box. For example,...
0
7920
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8054
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.