In Onselect event I have script:
$("#vinanghinguyen_images_bbocde").val('');
$("#vinanghinguyen_images_bbocde").val(vinanghinguyen_final_bbcode);
I want clear text area id="vinanghinguyen_images_bbocde" before add value to it. but textarea add add add add and value and not clear. I want clear it before add value
I use uploadify here is my function
<script type = "text/javascript" >
$(document).ready(function() {
vinanghinguyen_bbcode = '';
vinanghinguyen_final_bbcode = '';
vinanghinguyen_link = '';
vinanghinguyen_final_derect_link = '';
response = '';
$('#file_upload').uploadify({
'uploader' : '{SITE_FULL_URL}/uploadify/uploadify.swf',
'script' : '{SITE_FULL_URL}/uploadify/uploadify.php',
'cancelImg' : '{SITE_FULL_URL}/uploadify/cancel.png',
'folder' : 'data/picture_upload/2011',
'auto' : false,
'multi' : true,
'buttonText': '',
'onComplete': function(event, ID, fileObj, response, data) {
vinanghinguyen_bbcode = '[IMG]' + 'http://cnttvnn.com' + response + '[/IMG]' + '
';
vinanghinguyen_final_bbcode = vinanghinguyen_final_bbcode + vinanghinguyen_bbcode;
vinanghinguyen_derect_link = 'http://cnttvnn.com' + response + '
';
vinanghinguyen_final_derect_link = vinanghinguyen_final_derect_link + vinanghinguyen_derect_link;
$("#vinanghinguyen_images_bbocde").val('').val(vinanghinguyen_final_bbcode);
//$("#vinanghinguyen_images_derect_link").val(vinanghinguyen_final_derect_link);
$("#vinanghinguyen_result").show();
$(".uploadifyQueue").height(5);
},
'onSelect': function(event, ID, fileObj) {
$("#vinanghinguyen_images_bbocde").val('');
$("#vinanghinguyen_result").hide();
$(".uploadifyQueue").height(315);
},
});
});
</script>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…