Yii Framework Forum: Parse Value Or Parameter To Cjuidialog - Yii Framework Forum

Jump to content

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

Parse Value Or Parameter To Cjuidialog Rate Topic: -----

#1 User is offline   Quentinb 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 16-October 13

Posted 17 October 2013 - 05:29 AM

Hi again,

I have the following code:
	    <?php
$id = $data->id;
		    $this->widget('zii.widgets.jui.CJuiButton', array('buttonType'=>'button',
		    											'name'=>'btnContact'.$id,
		    											'caption'=>'Contact Poster', 
		    											'htmlOptions'=>array('onclick'=>'$("#postercontactwidget'.$id.'").dialog("open"); return false;')));


		    
		    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
		    	 	'id'=>'postercontactwidget'.$id, 
		    		'options'=>array(
		    				'title'=>'Contact Poster',
		    				'autoOpen'=>false,
		    				'modal'=>true,
		    				'width'=>480,
		    				'height'=>315,
		    		),

		    ));
		    
		    $this->widget('PosterContactWidget');
		    $this->endWidget('zii.widgets.jui.CJuiDialog');
		?>



Which works with this form:
<?php echo CHtml::beginForm(Yii::app()->homeUrl); ?>

<?php echo CHtml::hiddenField('posterid',$data->id); ?>
<?php echo CHtml::label('Your Email:','emailtxt'); ?>
<br/>
<?php echo CHtml::textField('emailtxt', '', array('id'=>'contactemail')); ?>
<br/>
<br/>
<?php echo CHtml::label('Your Comment:','commenttxt'); ?>
<br/>
<?php echo CHtml::textArea('commenttxt', '', array('id'=>'contactcomment','cols'=>'45','rows'=>'5')); ?>
<br/>
<br/>
<?php echo CHtml::button('Submit', array('submit' => array('Post/contactposter'))); ?>

<?php echo CHtml::endForm(); ?>


How can I parse a variable value to the CJuiDialog popup so that I can submit it with the form? all the fields on the CJuiDialog popup gets submitted and works 100%, but I need to send an extra variable from the page calling the CJuiDialog popup.

Thanks
0

#2 User is offline   Quentinb 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 16-October 13

Posted 18 October 2013 - 01:37 AM

Don't worry about this one, I got it working.
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