nn4n4s
03-19-2012, 05:38 PM
Hello.
I have got this kind of array:
$days = array('Monday' => '2012-03-19',
'Tuesday' => '2012-03-20'
);
I'm iterating like this:
foreach($days as $key => $value){
echo '<a href="javascipt:confirmDelete('.$value.');">Delete</a>';
}
Script:
function confirmDelete(day)
{
if (confirm('Delete?')) {
window.location.href = 'processDay.php?action=delete&day=' + day ;
}
}
While i hover over the link with coursor, it show it good: javascript:confirmDelete(2012-03-19), but when I submit the delete confirmation, i get &day=1987. Where is the problem?
I have got this kind of array:
$days = array('Monday' => '2012-03-19',
'Tuesday' => '2012-03-20'
);
I'm iterating like this:
foreach($days as $key => $value){
echo '<a href="javascipt:confirmDelete('.$value.');">Delete</a>';
}
Script:
function confirmDelete(day)
{
if (confirm('Delete?')) {
window.location.href = 'processDay.php?action=delete&day=' + day ;
}
}
While i hover over the link with coursor, it show it good: javascript:confirmDelete(2012-03-19), but when I submit the delete confirmation, i get &day=1987. Where is the problem?