Hello. I'm new to the forum. I'm updating a page someone else wrote; the function works on the old page but not the new page. I have done much work combining asp and javascript so I'm a little lost here.
On the first page there is a calendar control where the users picks a date.
There is some javascript at the top of the page that adds 1 day to the date selected.
Below the calendar, where the user selects the initial date, is some asp code that displays the new date ('sTermDate'). The new date does show up here. I've substituted 'TermDatePlus1' for 'sTermDate' and it still shows up so I know they are both populated.
I also need to get this date ('TermDatePlus1') into a variable that gets submitted to the next page for processing. The new date is put into a hidden variable and a Request.QueryString and sent to the next page where it's picked up by a dictionary object.
next page:
When it gets to the next page the variable is blank. I have a response.write dteffdate and it is always blank.
Any help would be appreciated!
On the first page there is a calendar control where the users picks a date.
Code:
<td align="Left"><input name="EffDate" id="DPC_date1" onfocus="showmydatepickercontrol(this);" type="text" style= "<%response.write StyleRequired%>"></td>
There is some javascript at the top of the page that adds 1 day to the date selected.
JavaScript:
function setTermNotice(tb) {
var str = tb.value; // date is MM/DD/YYYY
var sd = str;
var d = new Date(sd);
with (d) {
setDate(getDate() + 1 );
}
var sMonth = d.getMonth() + 1;
sMonth = "" + sMonth;
var sDay = d.getDate() + "" ;
if (sMonth.length == 1)
{
sMonth = "0" + sMonth; //zero fills month if less than 2 characters
}
if (sDay.length == 1) //zero fills day if less than 2 characters
{
sDay = "0" + sDay;
}
var mySpan = document.getElementById('sTermDate');
if (mySpan)
{ mySpan.innerHTML = sMonth + "/" + sDay + "/" + d.getFullYear(); }
var mytp1 = document.getElementById('TermDatePlus1');
if (mytp1)
{ mytp1.innerHTML = sMonth + "/" + sDay + "/" + d.getFullYear(); }
}
Below the calendar, where the user selects the initial date, is some asp code that displays the new date ('sTermDate'). The new date does show up here. I've substituted 'TermDatePlus1' for 'sTermDate' and it still shows up so I know they are both populated.
Code:
TermNotice = "All new enrollments will be effective <span id='sTermDate'>00000000</span>"
I also need to get this date ('TermDatePlus1') into a variable that gets submitted to the next page for processing. The new date is put into a hidden variable and a Request.QueryString and sent to the next page where it's picked up by a dictionary object.
HTML:
<input type="hidden" name="TermDatePlus1" value="">
Code:
dtEffDate = Request.QueryString("TermDatePlus1")
next page:
Code:
Set d=Server.CreateObject("Scripting.Dictionary")
d.add "dteffdate",dteffdate
When it gets to the next page the variable is blank. I have a response.write dteffdate and it is always blank.
Code:
response.write dteffdate
response.end
Any help would be appreciated!