Susymooie Pangrib
Susymooie Pangrib

Reputation: 3

how to disable button using jQuery in yii

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

Upvotes: 0

Views: 125

Answers (1)

RDK
RDK

Reputation: 4560

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"]')

Upvotes: 1

Related Questions