I want to use a JQuery UI dialog but i can’t. when I click different names, it loads the same page every time. The problem is there are too many hidden inputs so I just get the first value.
How can I do this dynamically?
PHP
while($s=mysql_fetch_array($a)) {
$name=$["name"];
<input type="hidden" class="hidden" value="<?php echo $name; ?>" />
<td class="dialog"><?php echo $name; ?></td>
}
JS
$('.dialog').click(function(){
variable=$('.hidden').val();
dialog1.load('page.php?do='+variable.dialog('open');
});
Basically I want to do this with JQuery:
<td><a href="page.php?do=<?php echo $name; ?>" > Go</a></td>
You can’t have anything inside a table that is outside the cell elements, so you have to put your
inputinside thetd:As the input is inside the cell, you can easily find it without setting a class on it:
(I am not sure about the second line inside the function. It was missing a parenthesis, so I added one where it looked like it was needed.)