View Full Version : how to view dhtml modal with id

11-10-2010, 01:56 AM
Good day!!!
I created a list view of the products, then I want to update that by clicking "Add details" using dhtml modal but i dont know how to pass the id on the hidden division i called on the function: here's my code:

$key = fetchProducts();
<img src="<?php echo DIR_IMAGES.$key['images']; ?>">
Product Name:<input type=text" name="p_name" value="<?php echo $key['p_name']?>">
<a href="#" onClick="addCQP(<?echo $keyt['id'];?>); return false"> Add details</a>

<script type="text/javascript">
function addCQP(value){
addwindow=dhtmlmodal.open('comment', 'div', 'modalalertdiv', 'Add Comments, Quantity & Priority', 'width=400px,height=350px,left=150px,top=100px,resize=0,scrolling=0')

<div id="modalalertdiv" style="display:none;">

<div style="background: #FFFFFF; height: 100%; padding: 5px">
<form id="addCQP">
$post = fetchProductById($id);
<img src="<?php echo DIR_IMAGES.$post['images']; ?>" style="height:105px; width:120px;">

Comment<br><textarea rows="4" cols="30"></textarea><br>
Quantity Desired <input type="text" name="quantity" style="width: 20px;"><br>
Quantity Received <input type="text" name="receive" style="width: 20px;"><br>
<select name="priority">
<option value="highest">highest</option>
<option value="high">high</option>
<option value="medium">medium</option>
<option value="low">low</option>
<option value="lowest">lowest</option>
<input type="button" value="Submit" style="margin-right: 20px" />
<input type="button" value="Cancel" />