1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I need help with printing the whole HTML form with currently filled values.

Discussion in 'JavaScript' started by asifakhtar, Jun 28, 2010.

  1. #1
    Hi,
    I have a form in which a user can create from 1 table to 10 tables which will dynamically create 2 HTML radio buttons, 12 checkboxes and 1 select drop down and 7 input textbox per table in JavaScript.

    I need help with printing the whole form with currently filled values.

    I tried window.print() but it only prints which is visible on the screen. It doesn’t print the bottom section which you have to scroll down to view.

    I also tried the following code as well but it prints radio buttons, checkboxes and select drop down with default value, not with the values currently selected or checked.

    
     
    function CallPrint()
    {
    	var answer = confirm("Do You Want to Print The Case?")
    	if (answer)
    	{
    		var prtContent = document.getElementById('PrintArea');
    		var WinPrint = window.open('','','left=0,top=0,width=1,height=1,t oolbar=0,scrollbars=0,status=0');
    		WinPrint.document.write(prtContent.innerHTML);
    		WinPrint.document.close();
    		WinPrint.focus();
    		WinPrint.print();		
    	}
    }
    
    Code (markup):
    Thanks
     
    asifakhtar, Jun 28, 2010 IP
  2. LargeChimp

    LargeChimp Peon

    Messages:
    265
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hmm, id of said that the window.print() should work, whats the px height of the form ?
     
    LargeChimp, Jun 28, 2010 IP
  3. asifakhtar

    asifakhtar Active Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #3
    How can I get the px height of the form ?
     
    asifakhtar, Jun 28, 2010 IP