i want to disable update button dan make it invisible using jQuery when update page is open, but if the value of payed is 1. i can get the value from database
somebody please help me, i'm a newbie in yii. thank you
Add this code to your view file:
<?php Yii::app()->clientScript->registerScript(
'disable-button',
'$('input[type="submit"]').attr('disabled','disabled');',
CClientScript::POS_READY
) ?>
But change jQuery selector on yours:
$('input[type="submit"]')
Related
I am using prestashop 1.7 and want to disable the popup and instead call a custom javascript function that toggles my shopping cart visible.
I found various instructions, however I don't have a file called ps_shoppingcart.js. The only one I have is the ps_shoppinccart.tpl which contains the HTML template.
Can someone help me to find where I can do the toggle?
If you take a look at the code of the master file of the module (ps_shoppingcart.php), you will see in the hookHeader() that the ps_shoppingcart.js is skipped when the option "Ajax cart" is turned off, so, you can remove these validation to keep the JS file loaded and in the file every time and now you can add your custom code, the code which show the popup is this:
if (resp.modal) {
showModal(resp.modal);
}
Hope this help you!
I have a switch to go to edit mode that is supposed to show the filters.
I am able to show them, but I do not know how to hide them when I quit the edit mode.
I tried the following but it is not working :
$('#myTable').find('.yadcf-filter').hide();
Any ideas?
Since all yadcf filters are being wrapped with a container that got the .yadcf-filter-wrapper class, the following should do
$('.yadcf-filter-wrapper').hide();
p.s
I'm yadcf author
I am using Yii framework and i want to update a div when click on a button.Div content updated successfully but its slider images are not updating.Here is my code view and controller.
https://gist.github.com/taleeb35/8da8a62141ef50cba794
This is my site when someone click on the update button new project and its images should be updated in div.
http://www.izons.com/portfolio/item/id/49
Any help will be appreciated.
Thanks
I am new to Yii, I am trying to get a CListView to update using ajax instead of refreshing the page. To make the simplest example, I am just feeding the CListView with a dataprovider and giving it the itemView parameter, nothing else. I want the pagination to update the page without refreshing. It works with gii generated crud pages but will not work with mine. I have added nothing extra, the code for the gii generated example and my own should be the same. Is there some setup step I am missing? Is there javascript missing in my layout that the default layout has perhaps? Thank you in advance.
It turns out that I was loading jQuery in my layout which was interfering with the jQuery library automatically loaded in Yii. Simply removing my jQuery include solved the problem. I will chalk this one up to being new at Yii and not knowing the inner workings of how it automatically includes javascript. Thanks guys, Rajat you put my mind on the right track, thanks.
I'm new to drupal,
I'm getting users favorite color from cck color picker then I want to set it to the background of the profile page. Profile page i created using views. I tried to do it from crating view tpl file but no luck is any way to do that task please direct me
this is obviously not complete code, as you need to figure out how to call the field data. I haven't tested this, but in theory this should work. Add this to the .tpl.php file, and see if it works.
<?php
header('Content-Type: text/css');
/*replace cckmachinename and fieldmachinename with actual code*/;
$user_color = cckmachinename -> fieldmachinename
?>
some selector {
background-color: <?php echo $user_color; ?>;
}
Hope this helps!