If you use fancybox v1.3.4, you will not be able to get the value ( .val()) using the callback onClosed, because it onClosedwill be executed when all the fancybox content has already been deleted. You rather use onCleanupinstead (you can still notify the value xafter closing fancybox)
so for Fancybox v1.3.4 use these API options
"onCleanup": function(){
x = $('#fancybox-frame').contents().find('#banner_width1').val();
},
"onClosed": function(){
alert("the value of input#banner_width1 is : "+x);
}
, var x; script, .
Fancybox v2.x API
beforeShow : function(){
x = $('.fancybox-iframe').contents().find('#banner_width1').val();
},
afterClose: function(){
alert("the value of input#banner_width1 is : "+x);
}