<script type="text/javascript">
function setRetention(duration) {
var lengthRetention = "";
var newAssignment = "";
var tempOrigDate = "";
if (duration.selectedIndex>0) { // e.g. not the "Select Option"
//works
lengthRetention += duration.options[duration.selectedIndex].value;
// not too sure if functioning right...
tempOrigDate += document.forms[0].origdate.value;
// or tempOrigDate += document.getElementsById('cdate').value;
// think its failing cause maybe Im not handling data-types correctly
tempOrigDate.setDate(tempOrigDate.getDate()+lengthRetention);
// adding this way makes sense right? integer 30 days + to date right?
}
// then I want to push that new calculated value to a display form field
duration.form.edate.value=newAssignment;
}
</script>
<%
' ASP.Net code
today = month(now) & "/" & day(now) & "/" & year(now)
Response.Write "<form name='edit' action='writetodb.asp' method='post'>"
'
Response.Write "Original Date: <input name=""origdate"" id=""origdate"" type=""text"" value='" & today & "'>"
'
Response.Write "Assign an extended Date:<br>"
Response.Write "<select name=""retention"" id=""retention"" onChange=""setRetention(this)"">"
Response.Write "<option selected=""selected"">Select an Extension Length</option>"
Response.Write "<option value=""30"";>30 days Active</option>"
Response.Write "<option value=""14"";>14 days Active</option>"
Response.Write "</select><br>"
'
Response.Write "Expiration Date: <br>"
'
' The Revised Date should populate and be displayed in this input field::.
Response.Write "<input type=""text"" name=""edate"" id=""edate"">"
'
Response.Write "<input type=submit value='UPDATE'>"
'
%>
</form>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE