I have create a jquery to convert title attribute of input to span with class "field_title". when I click on input though span class hide but input field remains disabled. Issue is I can't enable the input field.
<div class="field">
<input type="text" name="email" class="w_def_text" title="Email*" />
<img class="error" width="27" height="27" src="images/error.jpg" alt="Error">
</div>
<script>
function init_fields() {
$('.w_def_text').each(function() {
var text = $(this).attr('title');
var html = '<span class="field_title">' + text + '</span>';
$(this).parent().append(html);
if($(this).val() == '') {
$(this).hide();
$(this).next().show();
}
else {
$(this).css({'display' : 'block'});
$(this).next().hide();
}
});
$('.w_def_text').live('blur', function() {
if($(this).val() == '') {
$(this).hide();
$(this).next().show();
}
});
$('.w_def_text ~ span').live('click', function() {
$(this).hide();
$(this).prev().css({'display' : 'block'}).focus();
});
}
</script>