View Full Version : Dynamic Html urgent!!

03-28-2005, 05:20 PM
Hi All

I am very new to DHTML and I have very strange requirement. Here is code snippet
document.forms[0].target = 'myPrintWin';
var winLeft = (screen.width - 800) / 2;
var winTop = (screen.height - 675) / 2;
windowName = "myPrintWin";
var windowFeatures = "width=800,height=675,status=no,scrollbars,location=no,menubar,resizable,left=" + winLeft + ",top=" + winTop
var x=window.confirm("Click on Ok button to select html format of report and cancel to select text format of report")
if (x)
document.forms[0].format.value = 'html';
document.forms[0].format.value = 'text';
newWindow = window.open('',windowName,windowFeatures);
return true;

Here instead of javascript confirm I want to open a new window and add radio buttons with label text and html. Once user clicks on any of these radio buttons i want to close this window and open another window newWindow = window.open('',windowName,windowFeatures); whichsubmits the form and before that I need to set one field(you can see in my code format field to radio button selection .ie text/html) in my struts jsp. I have a problem as I can't do this using javascript as I will have to get input from user after clicking on text or html and I don't want to open window by giving url(Html page containing code for radio buttons).

I am planning to do this by using dhtml : once I click on print button in JSP using dhtml I will show window using div/class tag which will contain radio button code and then once user clicks in that window open anohter window and set the format field. Any help is highly appreciated.

Thanks in advance for your help..


04-18-2005, 05:10 PM
HI all

I could solve this..and learnt bit of DHTML..