I have 2 input typ button and an input type textfield. The both button are there to activate a function for adding or substracting some days .
In fact all is generated by ma database from mysql.
the thing is that I have many dates because the php script does manage some calendars with some actions associated to the dates.
sometimes we needs to manage the calendar in order to give few days after the meetings.
So i've done that function:
in javascript:
<script type="text/javascript">
function addday() {
var items = new Array();
var itemCount = document.getElementsByClassName("date");
for (var i = 0; i < itemCount.length; i++) {
items[i] = document.getElementById("date" + (i + 1)).value;
}
for (var i = 0; i < itemCount.length; i++) {
items[i] = document.getElementById("date" + (i + 1)).value;
var itemDtParts = items[i].split("-");
var itemDt = new Date(itemDtParts[2], itemDtParts[1] - 1, itemDtParts[0]);
nb=document.getElementById('nb').value;
itemCount[i].value = setDate(itemDt + nb) ;
}
return items;
}
</script>
the concern is that this script does not work.
I can not correct the mistakes I'm trying since 2 hours and i've read many about dates But I don't know how to.
first of all it says to me that setDate is not defined.
And the page is freezing.
Receive all my Utmost Respect.
SP.