Click here to Skip to main content
15,906,626 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Regular expression Pin
n.podbielski22-Nov-12 20:00
n.podbielski22-Nov-12 20:00 
GeneralRe: Regular expression Pin
Manfred Rudolf Bihy22-Nov-12 21:20
professionalManfred Rudolf Bihy22-Nov-12 21:20 
GeneralRe: Regular expression Pin
n.podbielski23-Nov-12 21:15
n.podbielski23-Nov-12 21:15 
Questionform validation Pin
therainking7821-Nov-12 22:07
therainking7821-Nov-12 22:07 
AnswerRe: form validation Pin
Richard MacCutchan21-Nov-12 22:17
mveRichard MacCutchan21-Nov-12 22:17 
GeneralRe: form validation Pin
therainking7828-Nov-12 13:14
therainking7828-Nov-12 13:14 
AnswerRe: form validation Pin
bVagadishnu28-Nov-12 11:14
bVagadishnu28-Nov-12 11:14 
GeneralRe: form validation Pin
therainking7828-Nov-12 13:17
therainking7828-Nov-12 13:17 
Questionopeing a new window in JS after time interval Pin
WaqasCheema20-Nov-12 23:36
WaqasCheema20-Nov-12 23:36 
AnswerRe: opeing a new window in JS after time interval Pin
AnalogNerd30-Nov-12 4:51
AnalogNerd30-Nov-12 4:51 
QuestionDraw circuit diagram using javascript Pin
anishkannan18-Nov-12 22:31
anishkannan18-Nov-12 22:31 
AnswerRe: Draw circuit diagram using javascript Pin
n.podbielski19-Nov-12 21:07
n.podbielski19-Nov-12 21:07 
Answerto transfer items in select list to another select list without duplicates Pin
raviteja999200014-Nov-12 20:09
raviteja999200014-Nov-12 20:09 
QuestionHow does Yandex do its trick? Pin
Xarzu14-Nov-12 19:42
Xarzu14-Nov-12 19:42 
AnswerRe: How does Yandex do its trick? Pin
Manfred Rudolf Bihy14-Nov-12 20:44
professionalManfred Rudolf Bihy14-Nov-12 20:44 
Questiondisplay record from two different time Pin
uti123fil8-Nov-12 17:15
uti123fil8-Nov-12 17:15 
AnswerRe: display record from two different time Pin
Richard MacCutchan8-Nov-12 23:47
mveRichard MacCutchan8-Nov-12 23:47 
QuestionAdding a month to the current date Pin
SadiqMohammed6-Nov-12 23:48
SadiqMohammed6-Nov-12 23:48 
AnswerRe: Adding a month to the current date Pin
Richard Deeming7-Nov-12 2:00
mveRichard Deeming7-Nov-12 2:00 
GeneralRe: Adding a month to the current date Pin
SadiqMohammed7-Nov-12 18:31
SadiqMohammed7-Nov-12 18:31 
GeneralRe: Adding a month to the current date Pin
Richard Deeming8-Nov-12 2:11
mveRichard Deeming8-Nov-12 2:11 
GeneralRe: Adding a month to the current date Pin
SadiqMohammed8-Nov-12 19:08
SadiqMohammed8-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 Pin
deepak.m.shrma19-Nov-12 18:07
deepak.m.shrma19-Nov-12 18:07 
GeneralRe: Adding a month to the current date Pin
Peter_in_278019-Nov-12 18:58
professionalPeter_in_278019-Nov-12 18:58 
GeneralRe: Adding a month to the current date Pin
deepak.m.shrma19-Nov-12 19:52
deepak.m.shrma19-Nov-12 19:52 

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

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