Yii Framework Forum: CHtml::submitButton with onClick - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CHtml::submitButton with onClick How to add an onClick confirm Rate Topic: -----

#1 User is offline   Ripley 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 03-July 12

Posted 03 July 2012 - 03:59 PM

I have inherited a php app with the yii framework. The syntax is foreign to me. I need the submit/register button to pop a disclaimer. So, I'm trying to do something like this...

echo '<div class="row buttons">';
echo CHtml::submitButton('Create Now',array('onClick'="return confirm('You agree to the term to register.\n\nPress OK to continue.')"));
echo '</div>';

Anyone have a suggestion, this isn't working???
0

#2 User is offline   Ripley 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 03-July 12

Posted 03 July 2012 - 04:35 PM

After playing with it for awhile I came up with...

echo '<div class="row buttons">';
echo CHtml: ubmitButton('Save', array('confirm'=>'You agree to the term to register.\n\nPress OK to continue.'));
echo '</div>';

It works, but it comes up twice like the post from #135921
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users