0

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();		
	}
}

Thanks

2
Contributors
1
Reply
4
Views
7 Years
Discussion Span
Last Post by fxm
0

printing the whole form with currently filled values.

This message http://www.daniweb.com/forums/post1242269.html#post1242269 tells you where to find exactly what you need. [Sorry, but I still haven't posted it here as a snipper :(] The page mentioned in that message also serves as a demo, of course.

Parts #2, #3 and #4 are invariant. Just copy them into your page as instructed; AFAIK they are completely cross-browser compatible. Ummm, Windows browsers anyway: Chrome, Firefox, Safari(pc),Opera,IE8, IE7 and [in theory at least] IE6.

Part #1 is, of course, completely arbitrary. You can use any method to invoke function printNodeById(sId) with the 'id' of any node or element.

If you would like to see the function in a small 'toy' version that prints various input elements all filled in, let me know. I will - finally - make that up as the long-promised a snippet.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.