I have a script that calls up a javascript calendar. The problem I 'm having is that it opens up so far at the bottom of the screen the user needs to grab it with the cursor and pull it up to be able to use it. Is it possible to tell the script to open in the middle of the screen?
Thanks
frosty1433
01-10-2007, 02:41 PM
Hi,
First thing you need to do is tell us some part of the code that is initing it... We cannot help you if you give us nothing to work with...
Here is the code that call the calendar.
Thanks
<?
session_start();
include "conn.php";
$id=$_POST['id'];
?>
<html>
<body
background="white" text= "#000000" link= "#A52A2A" vlink ="#A52A2A" alink= "#A52A2A">
<head>
<script language="javascript" src="http://xxx.xxx.xxx.xxx/customer/cal2.js">
</script></head>
<form name="process" form action="insertworkordtest.php" method="POST">
<?
echo "<input type='hidden' name='id' value='$id'>";
echo "<input type='hidden' name='community' value='$community'>";
$woid=$_POST['woid'];
if (isset($_GET['id']))
if (isset($_GET['community'])) {
$query2 = "SELECT DATE_FORMAT(date_add(cdate,interval 365 day),'%m-%d-%Y') FROM customers where id = '$id'";
$result2 = mysql_query($query2);
$row=mysql_fetch_row($result2);
$cdate = $row[0];
echo "<b>";
echo "Warranty Expires ";
echo $cdate;
echo "</b>";
echo "<br>";
}
$query = ("SELECT * FROM communties where community ='$community'");
$result = mysql_query($query);
$row=mysql_fetch_row($result);
?>
<h1><p align=center>The Corporation</h1><center><h4>Service Order<br><? echo $community;?><br><? echo
$row[2];?><br>Phone <? echo $row[3];?><br>Fax <? echo $row[4];?></h4>
<h3></h3></center>
<? echo $phone;?>
<?
if (isset($_GET['id']))
echo "SET $_GET[id]";
if (isset($_GET['community']))
echo "SET $_GET[community]";
$query1 = ("SELECT * FROM customers where id = '$id' and community ='$community'");
$result1 = mysql_query($query1);
$row=mysql_fetch_row($result1);
?>
<b>Lot/Building <?echo $row['10']?><?echo $row['11']?><br><?echo $row[1]?></br>
<?echo $row['2']?><br>
<?echo $row['3']?>,
<?echo $row['4']?>
<?echo $row['5']?><br>
<?echo $row['6']?><br>
</b>
<?// echo "Work Order $woid"//?>
<hr>
<p align = center> Contractor <? $query = mysql_query ("Select contractor from contractors order by
contractor ASC");
echo "<select name=\"contractor\" size=\"1\">\n";
for ($i=0;$i<mysql_numrows($query);$i++) {
echo "<option
value=\"".mysql_result($query,$i,"contractor")."\">".mysql_result($query,$i,"contractor")."</option>\n";
}
echo"</select>\n";?>
<script language="javascript" src="http://xxx.xxx.xxx.xxx/customer/cal_conf2.js"></script>
Appointment Date <input type="text" name="appoint" size="8" value ="<? echo isset($appoint) ;?>"><a
href="javascript:showCal('Calendar6')">Select Date</a>Time <input type = "text" name = "atime" size = 6
></center>
<p align = "center">Description</center><center><textarea rows="4" cols= "60" name
="description"></textarea></center>
<p align = center>Misc <input type="checkbox" name="misc" value = "Y">1 Year <input type="checkbox"
name="year" value="Y">Emergency <input type="checkbox" name="emergency" value ="Y">Standard Service Call
<input type="checkbox"name="stdservice" value="Y"></center>
<p align = center>Work done by <input type="text" name="workdoneby" size= "35" maxlength= 35></center></p>
<p align = center>Signature of Owner <input type = "text" name="ownersign" size= "30" maxlength=30>Date
<input type ="text" name="closeddate" size="8" maxlength=8></center> <p align=center>Above
work satisfactorily completed</center>Extra<input type="checkbox" name="extra" value= "Y">Contract <input
type="checkbox" name="contract" value= "Y">
<br>
<hr>
<p align = center>Construction Office</center>
<p align = center><script language="javascript" src="http://xxx.xxx.xxx.xxxx/customer/cal_conf2.js"></script>
Received from Customer <input type="text" name="recdate" size="8"><a
href="javascript:showCal('Calendar1')">Select Date</a><script language="javascript"
src="http://69.212.88.203/customer/cal_conf2.js"></script>
Customer Contacted <input type="text" name="contactdate" size="8"><a
href="javascript:showCal('Calendar7')">Select Date</a></center><script language="javascript"
src="http://xxx.xxx.xxx.xxx/customer/cal_conf2.js"></script><p align =center>
Inspected <input type="text" name="inspecteddate" size="8"><a href="javascript:showCal('Calendar9')">Select
Date</a></center><p align =center> Ordered by <input type="text" name="orderby" size="20"
maxlength=20><script language="javascript" src="http://69.212.88.203/customer/cal_conf2.js"></script>
<body>Issued to Contractor <input type="text" name="issuedate" size ="8"><a
href="javascript:showCal('Calendar2')">Select Date</a></center>
<br>
<input type=Submit name=Submit style="font-size:15" value="Submit">
<input type=Reset style="font-size:15" value="Reset"/>
<p align =center><a href="managerstart.php">Main</a></center>
</form>
</body>
</html>
<?
/*
<input type=Submit name=Submit style="font-size:15" value="Submit">
*/
?>
david_kw
01-11-2007, 05:20 PM
It doesn't look like you've called
function setSize(width, height, ox, oy)
yet with anything. So you are going to get the defaults. ox and oy are the offsets so try messing with those. The default seems to be
setSize(200, 200, -200, 16);
david_kw
I dont do much javascript where would something like that go?
Thanks
david_kw
01-11-2007, 05:48 PM
Try changing the <head> to be
<head>
<script language="javascript" src="http://xxx.xxx.xxx.xxx/customer/cal2.js">
</script>
<script type="text/javascript">
setSize(200, 200, -200, -100);
</script>
</head>
I think that should work. Of course I have no idea what the last 2 numbers should be to place the window where you want it. You'll have to experiment.
david_kw
I played with and it working great! Thanks for all of you help