Mobile Dialog

Hello fellows,

I’m finishing develop my website for mobile but one action that I have is the delete option and in the web version I’m using dialog to confirm the delete action and works very well but when I’m running my app in the iPhone browser the dialog doesn’t show up and I’m not able to delete what I need.

Does any one have a clue in how can I solve that?


That’s very strange. According to docs, iOs safari does support alert, confirm and prompt.

make use of Unobtrusive JavaScript fall back to normal delete call if javascript does not work

That’s what I’m thinking, it’s really weird. That’s my code:

<?php echo CHtml::link(




	'params'=>array('returnUrl'=>'index.php?r=notes/index'), 'confirm' => 'Are you sure that you want to delete ' . $model->title . '?')

); ?>

Thanks man but can you be more specific because I’m still not a Yii expert and neither Javascript.

Can you give me some code examples or something like that?

this should work even if you have javascript disabled

  16 <?php Yii::app()->clientScript->registerCoreScript("jquery"); ?>

  17 <script type="text/javascript">


  19 $(document).ready(function(){

  20   $('#deleteLink').click(function(){

  21     confirm("are you sure?");

  22   });

  23 });


  25 </script>


  27 <?php echo CHtml::link("Delete", array("site/admin"), array("id"=>"deleteLink")); ?>


:( It doesn’t work! Work in the browser but not in the phone. I don’t know what to do anymore!

what are you using to test the mobile site?

iOS Simulator from XCode and also my phone.

My project is online. Do you have a phone with you so you can test?

If you do go and sign up and create a note and try to delete.

BTW this project still in BETA version.

something is up with your site buddy I would suggest you to set up a test project and see if it works then implement it in your actual site

:( I will try that. Thanks man

I just added

<script src=""></script>

and now it shows the dialog but doesn’t delete anymore Neither in the web browser and the mobile. :confused:

It’s working now. I had to delete some javascript code. I guess that was a conflict ;)