Anele Ngqandu

Anele Ngqandu

  • NA
  • 19
  • 38.1k

Print Listbox contents

Jan 23 2012 7:22 AM
Hi guys

function driverprint()
{
  var textboxText = document.getElementById('<%= TextBox1.ClientID %>');
  var ListBox1 = document.getElementById('<%= ListBox1.ClientID %>');
  var windowUrl = 'about:blank';
  var windowName = 'Print' + new
  Date().getTime();
  var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
  printWindow.document.write(textboxText.value);
  printWindow.document.write(ListBox1.Value);
 
  printWindow.document.close();
  printWindow.focus();
  printWindow.print();
  printWindow.close();
}

Am printing textbox and listbox contents, Now problem is ListBox1.value is not printed,How can i solve this?