Click here to Skip to main content
11,578,739 members (59,636 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Javascript
in following code i have used a expression in alert box .how to apply that expression in a textbox named textToDate ...
function format()
    var m_names = new Array("January", "February", "March", "April", "May", "June", 
"July", "August", "September", "October", "November", "December");
    var gndate = document.getElementById("<%=txtDateTo.ClientID%>").value.split("/");
    var usedate=new Date(gndate[2],gndate[1]-1,gndate[0]);
    var today=new Date();
    var td=today.getDate();
    var gd=usedate.getDate();
    else if(usedate<today)
        alert("Invalid Sale Date!Enter present or future Date");
        return false;
    alert(  m_names[gndate[1]-1] +gndate[0] );
Posted 17-Mar-13 2:59am
Edited 17-Mar-13 3:10am
(no name)49.3K
Prasad Khandekar at 17-Mar-13 9:13am
How about using document.getElementById("<%=txtDateTo.ClientID%>").value = m_names[gndate[1]-1] +gndate[0];
ryanb31 at 22-Mar-13 11:51am
You should post this as the solution.
Sandeep Mewara at 17-Mar-13 9:38am
I don't see where are you setting any value in textbox. Please share what you tried that did not work.
nityasri at 17-Mar-13 10:05am
@ prasad..its working good now..thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Peter Leow 135
1 Frankie-C 115
2 OriginalGriff 113
3 Richard MacCutchan 85
4 Afzaal Ahmad Zeeshan 75
0 OriginalGriff 933
1 Sergey Alexandrovich Kryukov 740
2 Abhinav S 573
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 403

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 17 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100