Hi,

I am using symfony 1.0.11 scaffolding and on the delete action the
auto-generated functionality is something like this:

<?php echo link_to(image_tag('/sf/sf_admin/images/delete_icon.png',
array('alt' => __('delete'), 'title' => __('delete'))), 'event/delete?
id='.$event->getId(), array (
  'post' => true,
  'confirm' => __('Are you sure?'),
)) ?>

However in Internet Explorer (both 6 & 7) there is an issue: if you do
not click OK but cancel or close the prompt the action is still
performed.

The bug can be viewed on this video:
http://www.jippidy.com/cancel.wmv

The fault for this is entirely in IE I believe.

So, to fix the problem I have made the following fix in URLHelper
around line 361:

// $html_options['onclick'] = $onclick.'if
('._confirm_javascript_function($confirm).')
{ '._post_javascript_function().' };return false;';

// M.D. 14 october 2008 - fix for Cancel and Cancel by Close window
bug in IE
    $html_options['onclick'] = $onclick.'if
('._confirm_javascript_function($confirm).')
{ '._post_javascript_function().' } else
{this.href=document.location.href;} ;
this.href=document.location.href; return false;';

It works now in both IE and Firefox but at the price of this
meaningless redirect to the same page which is generally not needed
for other browsers.

Does anybody have a better solution to this?

Thanks,

Milena

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to