Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Date-Calendar How to display current date in textbox
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Laksmi Chandra
How to display current date in textbox
2 Answer(s)      5 years and 2 months ago
Posted in : Date-Calendar



Advertisement
View Answers

November 21, 2009 at 10:29 AM


Hi Friend,

Try the following code:

<script>
function addDate(){
date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var year = date.getFullYear();

if (document.getElementById('date').value == ''){
document.getElementById('date').value = day + '-' + month + '-' + year;
}
}
</script>
<body onload="addDate();">
Today's Date is: <input type="text" id="date">
</body>

Thanks


February 2, 2012 at 12:46 PM


very helpful code for beginners like me. Thank you very much.



Related Tutorials/Questions & Answers:
How to display current date in textbox - Date Calendar
How to display current date in textbox  Hi guys, I'm really need your...;% } This is my problem: I want to display current date in textbox... Date(); var month = currentTime.getMonth() + 1; var day
how to display(update) current date and month in select box on selecting the year.
how to display(update) current date and month in select box on selecting the year.  how to display(update) current date and month in select box on selecting the year
Advertisements
How to display the current time
How to display the current time  I was develop online web portal. In this web portal i am going to display time. I am using <%= new java.util.Date() %> to display the time. But it display the time after that cannot changed
Display current date in text box in JSP using javascript
Display current date in text box in JSP using javascript In this section you will learn how to display current date in text box using JavaScript.For... element through id attribute and used the value property to store the current date
How to get the current date in Java?
How to get the current date in Java?  Hi, I am new to Java and trying to write a program to get the current date. How to get the current date in Java? Thanks   Hi, Check the tutorial: Java program to get current date
how to get current date without system date
how to get current date without system date  is there any possiblity to get current date instead of system date in Java, as i dont want to change date in program and if i change date in OS automatically change in program also
How automatically calculate age based on date of birth and current date using jsp and servlet?
How automatically calculate age based on date of birth and current date using jsp and servlet?  when user enters the Date of birth in one textbox then automatically age will be display on another textbox. event:Onlick Event
Display Current Date using JSP Custom(user define) Tag
Display Current Date using JSP Custom(user define) Tag In this section, we will discuss about how to display current date & time using  custom(user... page Deploy the application EXAMPLE : In this Example, Current date
How to display on textbox using ObjectUtil class
How to display on textbox using ObjectUtil class       In this tutorial we will see how to display a text in textbox using ObjectUtil class. Here
Java current date - How to get current date in Java
In this section, you will learn about displaying current date and time in Java
Write an Applet which display current date and time on the web page??
Write an Applet which display current date and time on the web page??  Write an Applet which display current date and time on the web page??  Here is an applet code that display date and time. import java.applet.
Write an Applet which display current date and time on the web page??
Write an Applet which display current date and time on the web page??  Write an Applet which display current date and time on the web page?  Here is an applet code that display date and time. import java.applet.
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE  Dear sir, Am having one table called rolemaster. In that there are 2 fields... is how to get Roleid in textbox when i select Role_name from combobox in a same
convert current date into date format
convert current date into date format  How to get current date and convert into date format in Java or PHP
date in textbox on page load
date in textbox on page load   i want to insret the current date...;/html>   Here is a javascript code that insert the current date into textbox on page load. <html> <script> function addDate(){ date = new
how to display textbox value based on selected option value?
how to display textbox value based on selected option value?  Hi,I have some problem. I use jsp and ajax. first select: 1 second select:2 based on first value I finished above code. ID: xx Name:xx xx is baesd on second
How can we get second of the current time using date function?
How can we get second of the current time using date function?  How can we get second of the current time using date function
javascript current date and time.
javascript current date and time.  How can we display current date...;Current date and time</title> </head> <script type="text/javascript... write new Date() it shows the current date in standard format
Current date in php
Current date in php  How to show the current date in the HTML page using PHP Script
Iphone Current Date Application
Iphone Current Date Application  Hi, I am a beginner in the mobile web application segment. How can i develop Iphone Current Date Application. I need the online help guide or example about iphone current date format. Thanks
iPhone Current Date, iPhone Current Date Application
; In this wesynthesize variable and also to display current date we use Stringwhich isdeclared... to display current dateon label by using Window based application. Creating...:NSDateFormatterNoStyle];    NSDate*date =[NSDatedate];  //toprint date
display he new customer no in textbox
display he new customer no in textbox   i want to add the new customer for that when i click on add butto the new customernumber should be display in textfield . plz ell me the suggestions & code
get date picker values to a textbox
get date picker values to a textbox  I am using DatePicker to select date in a form in asp.net using c#. I need the picked data to get in to a textbox. Please help me soon
current date set
current date set  I need to set current date as default in a drop down list which has a label tag too in my jsp page.please somebody help me
current date in php
current date in php  PHP script to get current date.   Hi, You can use the following code to print the current in PHP: <?php echo date('y m d'); ?> With the help of following code you can get the current date
display data from database in textbox when id entered in textbox
display data from database in textbox when id entered in textbox  i wanted to enter data in textbox .depending on entered data in textbox data from database should be displayed dynamically in textbox
Write date servlet and test on tomcat
Display the current date with a Servlet  ... to display a current date and current time on the client browser.  It is very easy to display current date with the help of a servlet program using
Insert current date into MYSQL database
Insert current date into MYSQL database In this tutorial, you will learn how to insert current date into database. In most of the applications.... And to insert current date to database, we have created an instance of Date class
Mysql Date Arithmetic
Date Arithmetic is used to display the current date, interval in current date and time. Understand with Example The Tutorial illustrate... the select now ( ) query that return you the current date and time. SYNTAX:-date
JDBC : Current Date
JDBC : Current Date In this section, you will learn query for current date. Display Current Date : There are various methods provided by MYSQL to get current date. These are CURRENT_DATE, CURRENT_DATE(), CURRENT_TIMESTAMP, CURRENT
Iphone Show Current Date & Time
are going to show you how to print both current date and current time in iphone... to display the current date and time in phone application. please see the code...Iphone Show Current Date & Time In the previous examples, we have
 

 

 

DMCA.com