Hello,
I want to open and dialog box on onclick of image.
for that , i had written below onclick code to call function and pass parameter to it.
this $skills_id is unique.
What I want next is,
using this $skills_id, I want open dialog box which fetches and shows details using taht perticular $skills_id

echo "<td><span>".CHtml::link('<input type="image"
                     src="'.Yii::app()->request->baseUrl."/images/update.png".'" 
                     title="Approve/Disapprove Skill" style="height:15px; width:15px" class="form-button1" value="VIEW" id="say_it">','#',
                     array('onclick'=>'open_box('.$skills_id.')',));

but how to open a dialog box?
i want it like

<div id='box2'>
<?$name= name($skill_id);
$designation=designation($skill_id);
?>
    Name: <? echo $name; ?>
    designation: <? echo $designation; ?>
    <!-- details like this. -->
    <div id='id_disapprove_note'>
 <span class='form_lable_'><?php echo CHtml::label('Comments','disapprove_comment').": "?></span>
        <?php echo CHtml::TextArea('disapprove_comment','',$htmlOptions=array('style'=>"width: 250px",'class'=>'required','rows' => 6, 
        'cols' => 28, 'maxlength'=>500,'id'=>'disapprove_note'.$skills_id ,'title'=>'Please provide comments for Disappoval')) ?>
</div>
    <? echo CHtml::button('approve', array('id'=>'approve','onclick'=>'approve(1,'.$skills_id.',"'.$EmployeeName.'","'.$EmployeeGSID.'")','style'=>'position:  absolute;margin-left:29%;',));?>
    <? echo CHtml::button('disapprove', array('id'=>'disapprove','onclick'=>'approve(2,'.$skills_id.',"'.$EmployeeName.'","'.$EmployeeGSID.'")','style'=>'position:  absolute;margin-left:45%;')); ?>
</div>

and on onclick, in approve ().
i want to take comments from box and close the dialog box.

Hello there.
If you seeking help in a JS forum, try to post the final HTML and JS code. Not PHP code.

About the dialog, try using jQuery UI, it's quite simple.

http://jqueryui.com/dialog/#modal-form

Member Avatar for dany4ev_1

Hi Priti P,

There area number of ways to do that. You can write some custom javascript to display a dialogue pop up or you could use jquery ui like mentioned by AleMonteiro above or you can use simple window.open, a more better approach would be to use jquery based fancybox. It's super easy to use have a decent online documentation and very compatible accross various browsers.

Just to get you started here is the link to their site:

http://fancyapps.com/fancybox/

http://fancybox.net/

Hope this helps in resolving your query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.