I'm having some issues with my code maybe you could help?
Jquery: [updated]
<script>
$(function() {
$(".val_error").dialog({
autoOpen: false,
show: "blind",
hide: "explode"
});
$(".val_open").click(function(event) {
var target = $(this).attr("id");
$('#' + target).dialog('open');
return false;
});
});
</script>
HTML: [updated]
<p class="first_name>
<div class="val_error" id="first_name_err"><?php echo form_error('first_name'); ?></div>
<label for="contact_first_name"><?php echo $label_values->first_name;?></label>
<?php echo form_input('first_name', $form_values->first_name, 'id="first_name"');?>
<button class="val_open" id="first_name">Open</button>
</p>
<p class="last_name">
<div class="val_error" id="last_name_err"><?php echo form_error('last_name'); ?></div>
<label for="contact_last_name"><?php echo $label_values->last_name;?></label>
<?php echo form_input('last_name', $form_values->last_name, 'id="last_name"');?>
<button class="val_open" id="last_name">Open</button>
</p>
So basically I'm trying to get the dialog to open for just one ID at a time rather than all at once.. I've tried the following but no luck:
Jquery I thought would work
<script>
$(function() {
$(".val_error"+target).dialog({
autoOpen: false,
show: "blind",
hide: "explode"
});
$(".val_open").click(function(event) {
var target = $this.attr("id");
$(".val_error").dialog("open");
return false;
});
});
</script>
Any help / pointers or even ideas would be great!
http://jsfiddle.net/dRRRd/ <- can view here