Chtml Link With Confirm

Hi all,

I have the following:

This does not pop-up the confirm box.




<?php 

echo CHtml::link(

	'Finalise Invoice',

	array('/print/printpdf'), 

	array("target"=>"_blank"),

	array('confirm'=> 'Are you sure you want to finalise your invoice?'));

?>



This does pop-up the confirm box.




<?php 

echo CHtml::link(

	'Finalise Invoice',

	array('/print/printpdf'), 

	array('confirm'=> 'Are you sure you want to finalise your invoice?'));

?>



So it seems to be the target property setting or do I have to many parameters set?

Any ideas how to fix it?

Thanks

Try this:




<?php 

echo CHtml::link(

        'Finalise Invoice',

        array('/print/printpdf'), 

        array(

        	'target' => '_blank',

        	'confirm' => 'Are you sure you want to finalise your invoice?'

        ));

?>



According to me confirm and target could not work together

http://www.yiiframework.com/wiki/48/by-example-chtml/#hh0

So simple if you know how.

Above solution works 100%, thank you.

Sorry, just to expand on this.

How would I get this to work?

What I want is when the user clicks on the link, a new window must open and the current window must reload on when the "OK" button was clicked on the confirm box.

I have tried this:




<?php 

echo CHtml::link(

        'Finalise Invoice',

        array('/print/printpdf'), 

        array("target"=>"_blank"),

        array('confirm'=> 'Are you sure you want to finalise your invoice?', 'onClick'=>'window.location.reload'));

?>