Click here to Skip to main content
       

JavaScript

 
Questionopeing a new window in JS after time interval PinmemberWaqasCheema20-Nov-12 23:36 
AnswerRe: opeing a new window in JS after time interval PinmemberAndrew Stoute30-Nov-12 4:51 
QuestionDraw circuit diagram using javascript Pinmemberanishkannan18-Nov-12 22:31 
AnswerRe: Draw circuit diagram using javascript Pinmembern.podbielski19-Nov-12 21:07 
Answerto transfer items in select list to another select list without duplicates Pinmemberraviteja999200014-Nov-12 20:09 
QuestionHow does Yandex do its trick? PinmemberXarzu14-Nov-12 19:42 
AnswerRe: How does Yandex do its trick? [modified] PinmvpManfred R. Bihy14-Nov-12 20:44 
Questiondisplay record from two different time Pinmemberuti123fil8-Nov-12 17:15 
AnswerRe: display record from two different time PinmvpRichard MacCutchan8-Nov-12 23:47 
QuestionAdding a month to the current date PinmemberSadiqMohammed6-Nov-12 23:48 
AnswerRe: Adding a month to the current date PinmemberRichard Deeming7-Nov-12 2:00 
GeneralRe: Adding a month to the current date PinmemberSadiqMohammed7-Nov-12 18:31 
GeneralRe: Adding a month to the current date PinmemberRichard Deeming8-Nov-12 2:11 
GeneralRe: Adding a month to the current date PinmemberSadiqMohammed8-Nov-12 19:08 
Hi Richard,
Thanks for the suggestion Smile | :) I solved the problem and I'm getting the desired result, I faced a problem only for the month of November i.e, 11th month but I resolved it using the following code with the help of a if block
function populateArchive() {
var frm=document.form1;
var input;
var monthVal;
var monthMax = new Array(31,31,29,31,30,31,30,31,31,30,31,30,31);
var top ;
 

if (validateDateFormat(frm.story_intro_date) && frm.story_exp_date.disabled == false) {
 
var post_date = new Date(frm.story_intro_date.value);
var expiration_date = new Date(post_date.setMonth(post_date.getMonth() ));
var new_date = expiration_date.getDate();
var new_month = expiration_date.getMonth()+ 2;
var new_year = expiration_date.getFullYear();
if (new_month == 13) {
new_month = new_month - 12;
new_year = new_year + 1;
}
input = parseInt(new_date, 10);
monthVal = new_month;
top = monthMax[monthVal];
if (!inRange(input, 1, top)) {
expiration_date_new = new_month + "/" + top + "/" + new_year;
}
else
expiration_date_new = new_month + "/" + new_date + "/" + new_year;
frm.story_exp_date.value = expiration_date_new;
frm.hdn_story_exp_date.value = expiration_date_new;
}
 
}
 
thanks for ur suggestions once again
AnswerRe: Adding a month to the current date Pinmemberdeepak.m.shrma19-Nov-12 18:07 
GeneralRe: Adding a month to the current date PinmemberPeter_in_278019-Nov-12 18:58 
GeneralRe: Adding a month to the current date Pinmemberdeepak.m.shrma19-Nov-12 19:52 
QuestionNeed to pass object value from javascript to php Pinmembergern844-Nov-12 10:08 
SuggestionRe: Need to pass object value from javascript to php Pinmembern.podbielski4-Nov-12 12:56 
GeneralRe: Need to pass object value from javascript to php Pinmembergern844-Nov-12 13:29 
GeneralRe: Need to pass object value from javascript to php Pinmembern.podbielski4-Nov-12 20:48 
GeneralRe: Need to pass object value from javascript to php Pinmemberzengnanhua22-Nov-12 18:27 
GeneralRe: Need to pass object value from javascript to php PinmemberKillzone DeathMan22-Nov-12 23:39 
QuestionWindow restore Pinmembermkotaska1-Nov-12 6:00 
AnswerRe: Window restore Pinmemberryanb312-Nov-12 11:03 
Questionunzip the .gzip files [modified] PinmemberKIDYA31-Oct-12 19:44 
AnswerRe: unzip the .gzip files PinmemberJay Zhu2-Nov-12 17:20 
Questioni have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. PinmemberAbhishek Prakash30-Oct-12 5:53 
AnswerRe: i have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. [modified] Pinmembern.podbielski30-Oct-12 21:48 
GeneralRe: i have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. PinmemberAbhishek Prakash30-Oct-12 23:40 
GeneralRe: i have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. PinmemberAbhishek Prakash30-Oct-12 23:48 
GeneralRe: i have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. Pinmembern.podbielski31-Oct-12 1:50 
GeneralRe: i have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. PinmemberAbhishek Prakash31-Oct-12 2:44 
GeneralRe: i have created 3 widgets using jquery ui - header, footer, textarea. i am observing abnormal behavior because of the footer widget. Pinmembern.podbielski31-Oct-12 6:11 
QuestionWorking example for Javascript to call a java webservice Pinmembersekhar48429-Oct-12 23:50 
AnswerRe: Working example for Javascript to call a java webservice PinmvpRichard MacCutchan30-Oct-12 0:54 
AnswerRe: Working example for Javascript to call a java webservice Pinmemberryanb312-Nov-12 11:04 
GeneralRe: Working example for Javascript to call a java webservice PinmemberMember 946160725-Nov-12 19:32 
QuestionJS::Page a serious fault Pinmemberlsw52131425-Oct-12 21:14 
AnswerRe: JS::Page a serious fault Pinmemberenhzflep27-Oct-12 9:57 
QuestionFill a "2D" Array with random values Pinmember0bx24-Oct-12 12:27 
AnswerRe: Fill a "2D" Array with random values Pinmemberenhzflep26-Oct-12 20:52 
QuestionFlexigrid Pinmemberchandra reinhart15-Oct-12 1:23 
Questionpagination Pinmembermillekekez12-Oct-12 22:32 
QuestionProblem with IE 9 Pinmembergiocot11-Oct-12 7:21 
AnswerRe: Problem with IE 9 PinmemberMember 950758611-Oct-12 23:02 
AnswerRe: Problem with IE 9 Pinmemberjkirkerx17-Oct-12 12:20 
AnswerRe: Problem with IE 9 Pinmembertwseitex19-Oct-12 7:39 
Questionwindow.open not working inside frame in google chrome. PinmemberVirjin Antony10-Oct-12 1:57 
AnswerRe: window.open not working inside frame in google chrome. Pinmembertwseitex19-Oct-12 8:28 

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
Web02 | 2.8.140827.1 | Last Updated 29 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid