By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

help with popup win

P: 6
I'm really confused here...i'll need some help with the following... i have a sceipt that will open a popup win which is actually a calendar and i'm trying to apply a style on the popup...

Here's the popup code:
Expand|Select|Wrap|Line Numbers
  1.                 var cal1 = new calendar1(document.forms['test'].elements['input1']);
  2.                 cal1.year_scroll = true;
  3.                 cal1.time_comp = false;
calendar1 is:
Expand|Select|Wrap|Line Numbers
  1. function calendar1(obj_target) {
  2.  
  3.     // assigning methods
  4.     this.gen_date = cal_gen_date1;
  5.     this.gen_time = cal_gen_time1;
  6.     this.gen_tsmp = cal_gen_tsmp1;
  7.     this.prs_date = cal_prs_date1;
  8.     this.prs_time = cal_prs_time1;
  9.     this.prs_tsmp = cal_prs_tsmp1;
  10.     this.popup    = cal_popup1;
  11.  
  12.     // validate input parameters
  13.     if (!obj_target)
  14.         return cal_error("Error calling the calendar: no target control specified");
  15.     if (obj_target.value == null)
  16.         return cal_error("Error calling the calendar: parameter specified is not valid target control");
  17.     this.target = obj_target;
  18.     this.time_comp = BUL_TIMECOMPONENT;
  19.     this.year_scroll = BUL_YEARSCROLL;
  20.  
  21.     // register in global collections
  22.     this.id = calendars.length;
  23.     calendars[this.id] = this;
  24. }
and cal_popup1 is:
Expand|Select|Wrap|Line Numbers
  1. function cal_popup1 (str_datetime) {
  2.     if (str_datetime)
  3.         this.dt_current = this.prs_tsmp(str_datetime);
  4.     else 
  5.         this.dt_selected = this.dt_current = this.prs_tsmp(this.target.value);
  6.  
  7.     if (!this.dt_current) return;
  8.  
  9.     var obj_calwindow = window.open(
  10.         'calendar.html?id=' + this.id + '&s=' + this.dt_selected.valueOf() + '&c=' + this.dt_current.valueOf(),
  11.         'Calendar', 'width=200,height=' + (this.time_comp ? 215 : 190) +
  12.         ',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
  13.     );
  14.     obj_calwindow.opener = window;
  15.     obj_calwindow.focus();
  16. }
What i'm trying to do is to apply the following somewhere inside one (?) of the above three functions...
Expand|Select|Wrap|Line Numbers
  1. var win = new Window({className: "spread", title: "Ruby on Rails", 
  2.                       top:70, left:100, width:300, height:200, 
  3.                       url: "calendar.html", showEffectOptions: {duration:1.5}})
Nov 17 '07 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
How is Window defined and where?
Nov 17 '07 #2

P: 6
you are asking for this?
Expand|Select|Wrap|Line Numbers
  1.             <form action="" method="post" name="test">
  2.             <input type="Text" name="input1" value=""><a href="javascript:cal1.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a>
Nov 17 '07 #3

acoder
Expert Mod 15k+
P: 16,027
I meant the Window object which you're calling with "var win = new Window(...)".

I see that you're using window.open to open a popup. You won't be able to style that like you would a DHTML pseudo-popup. You can make a few changes, e.g. change the height, width, position, but you should do that before opening the window.
Nov 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.