Post by dangkhoaweb » Fri Jan 15, 2010 10:01 am

When you delete an item or list of items in admin, it does directly. I think it is better if we confirm before act. So I add a javascript in admin\view\template\common\header.tpl

Code: Select all

<script type="text/javascript" language="javascript">
function delete_item() 
{
	var value = confirm("Are you sure?");
	if (value==false)
	{
		return;
	}
	else
	{
		$('form').submit();
	}
}
</script>
Now in each template, example download_list.tpl, replace

Code: Select all

<a onclick="$('form').submit();" class="button">
by

Code: Select all

[b]<a onclick="delete_item()" class="button">[/b]
Done.

Newbie

Posts

Joined
Wed Jan 13, 2010 11:34 am

Post by Qphoria » Fri Jan 15, 2010 10:39 am

Welcome to the forums.
Search button is your friend.
Especially when I made this mod not more than 7 hours ago
http://forum.opencart.com/viewtopic.php?f=23&t=9518 ;)

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dannowatts » Fri Jan 15, 2010 11:55 am

i'm kind of lad this isn't on by default, because i know when i delete something, i want it deleted. i don't want to have to click enter multiple times or click 'ok' each time i delete something.

but it's good to note that you came up with something and q has a mod as well that he created not too long ago ;)


rocksteady,
danno~

New member

Posts

Joined
Tue Nov 10, 2009 11:40 am
Who is online

Users browsing this forum: No registered users and 4 guests