I use Facebox ( http://defunkt.github.com/facebox/ ) on one of my sites. I also make extensive use of jQuery on the site.
My problem is that the .val () function does not work inside facebox. Now this is a DIV that displays as facebox:
<div id="edit-tags" style="display: none;">
<script type="text/javascript">
$('.add-tag-form').submit(function(){
alert($('input.tags-input').val());
return false;
});
</script>
<form class="add-tag-form">
<input type="text" name="tags-input" class="tags-input" />
<input type="submit" class="small-button" value="Add Tag" />
<form>
</div>
Now the problem is that the value input.tags-inputdoes not appear in the warning window. It appears blank.
To make the problem worse, jQuery selection really works. That is, it $('input.tags-input').hide()works fine.
To make the problem worse, it .val()works with the initial value. That is, if I use this:
<input type="text" name="tags-input" class="tags-input" value="Some value" />
Then in the warning window “Some value” is displayed, regardless of whether I change the value or not.
. .val() facebox.