Click here to Skip to main content
11,412,159 members (62,071 online)

JavaScript

 
QuestionDraw circuit diagram using javascript Pinmemberanishkannan18-Nov-12 23:31 
AnswerRe: Draw circuit diagram using javascript Pinmembern.podbielski19-Nov-12 22:07 
Answerto transfer items in select list to another select list without duplicates Pinmemberraviteja999200014-Nov-12 21:09 
QuestionHow does Yandex do its trick? PinmemberXarzu14-Nov-12 20:42 
AnswerRe: How does Yandex do its trick? [modified] PinmvpManfred R. Bihy14-Nov-12 21:44 
Questiondisplay record from two different time Pinmemberuti123fil8-Nov-12 18:15 
AnswerRe: display record from two different time PinmvpRichard MacCutchan9-Nov-12 0:47 
QuestionAdding a month to the current date PinmemberSadiqMohammed7-Nov-12 0:48 
Hi,
I have a scenario where I have to enter a date in a text box in MM/DD/YYYY format and there is another text box where the value should be filled by itself and the value must be exactly one month from the entered date i.e, if my value in the first text box is 05/07/2012 second text box should automatically possess 05/08/2012 and this should be done by javascript, below is the code I tried but the second text box is taking the same value as the first text box, can someone please help me out with this issue and tell me what's wrong with the code


function populateArchiveDate() {
var frm=document.form1

if (validateDateFormat(frm.story_intro_date) && frm.story_exp_date.disabled == false) {

var post_date = new Date(frm.story_intro_date.value);
alert(post_date.getMonth());
var expiration_date = new Date(post_date.setMonth(post_date.getMonth() + 1));
alert(expiration_date.getMonth());

if (expiration_date.getMonth() == 0)
expiration_date = expiration_date.getMonth() + 1 + "/" + expiration_date.getDate() + "/" + expiration_date.getFullYear();
else
expiration_date = expiration_date.getMonth() + "/" + expiration_date.getDate() + "/" + expiration_date.getFullYear();

frm.story_exp_date.value = expiration_date;
frm.hdn_story_exp_date.value = expiration_date;






Thanks in advance Smile | :)
AnswerRe: Adding a month to the current date PinmemberRichard Deeming7-Nov-12 3:00 
GeneralRe: Adding a month to the current date PinmemberSadiqMohammed7-Nov-12 19:31 
GeneralRe: Adding a month to the current date PinmemberRichard Deeming8-Nov-12 3:11 
GeneralRe: Adding a month to the current date PinmemberSadiqMohammed8-Nov-12 20:08 
AnswerRe: Adding a month to the current date Pinmemberdeepak.m.shrma19-Nov-12 19:07 
GeneralRe: Adding a month to the current date PinmemberPeter_in_278019-Nov-12 19:58 
GeneralRe: Adding a month to the current date Pinmemberdeepak.m.shrma19-Nov-12 20:52 
QuestionNeed to pass object value from javascript to php Pinmembergern844-Nov-12 11:08 
SuggestionRe: Need to pass object value from javascript to php Pinmembern.podbielski4-Nov-12 13:56 
GeneralRe: Need to pass object value from javascript to php Pinmembergern844-Nov-12 14:29 
GeneralRe: Need to pass object value from javascript to php Pinmembern.podbielski4-Nov-12 21:48 
GeneralRe: Need to pass object value from javascript to php Pinmemberzengnanhua22-Nov-12 19:27 
GeneralRe: Need to pass object value from javascript to php PinmemberKillzone DeathMan23-Nov-12 0:39 
QuestionWindow restore Pinmembermkotaska1-Nov-12 7:00 
AnswerRe: Window restore Pinmemberryanb312-Nov-12 12:03 
Questionunzip the .gzip files [modified] PinmemberKIDYA31-Oct-12 20:44 
AnswerRe: unzip the .gzip files PinmemberJay Zhu2-Nov-12 18:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | Last Updated 25 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid