JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 5th, 2011, 02:14 PM
kamalkochar kamalkochar is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2011
Posts: 1 kamalkochar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 7 sec
Reputation Power: 0
Open multiple windows in IE using Javascript??

Hi All,

What i want to do is - I have a grid view and in that there are check box and a hyperlink to another form in each row. I need to select multiple check box and hit on Print Button. It should print all the forms (linked by hyperlink) with same url but different parameters.

Problem is that i have written the code which is working fine but sometimes it behaves very uncertain. When i check few check boxes, let say 5; 5 new windows are opened but sometimes same window is loaded with new url and print command comes only for 3 windows and skips for the other two overridden.

function PrintForm(dataGridView) {
var objSearch = document.getElementById(dataGridView);
var ControlId = '';
var txtAppend = '';
var hidReqid = '';
var txtReqId = '';
if(objSearch) {
var objSearchRows = objSearch.rows.length; }
//Loop thru the grid rows and check for the checked checkboxes
for ( var rowCount = 2; rowCount < objSearchRows + 1; rowCount++ ) {
if(rowCount < 10) {
txtAppend = '_ctl0'; }
else {
txtAppend = '_ctl'; }
ControlId = objSearch.id + txtAppend + rowCount + '_chkSelect';
ControlId = document.getElementById(ControlId);
if(ControlId) {
if(ControlId.checked == true) {
hidReqid = objSearch.id + txtAppend + rowCount + '_hidRqstId';
txtReqId = document.getElementById(hidReqid).value;
var mywindow = window.open('PrintForm.aspx?RqstId='+txtReqId,'Req uestForm'+txtReqId,"toolbar=no,resizable=yes, scrollbars=yes,menubar=no, location=no, height=30, width=30");
window.focus();
mywindow.print();
mywindow.close();
}
}
}
}

Please help......!!!!

Last edited by kamalkochar : September 5th, 2011 at 02:17 PM. Reason: Changed Formatting

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Open multiple windows in IE using Javascript??


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap