View Full Version : Where script opens on page

Jan 10th, 2007, 03:39 PM
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?


Jan 10th, 2007, 03:41 PM
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...

Jan 11th, 2007, 05:44 PM
Here is the code that call the calendar.


include "conn.php";


background="white" text= "#000000" link= "#A52A2A" vlink ="#A52A2A" alink= "#A52A2A">

<script language="javascript" src="http://xxx.xxx.xxx.xxx/customer/cal2.js">

<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'>";

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);
$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);

<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>
<? 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);


<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>

<?// echo "Work Order $woid"//?>
<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

<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

<p align = "center">Description</center><center><textarea rows="4" cols= "60" name


<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">

<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"

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=""></script>
<body>Issued to Contractor <input type="text" name="issuedate" size ="8"><a

href="javascript:showCal('Calendar2')">Select Date</a></center>
<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>

<input type=Submit name=Submit style="font-size:15" value="Submit">

Jan 11th, 2007, 06: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);


Jan 11th, 2007, 06:42 PM
I dont do much javascript where would something like that go?


Jan 11th, 2007, 06:48 PM
Try changing the <head> to be

<script language="javascript" src="http://xxx.xxx.xxx.xxx/customer/cal2.js">
<script type="text/javascript">
setSize(200, 200, -200, -100);

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.


Jan 12th, 2007, 03:18 PM
I played with and it working great! Thanks for all of you help