calendar popup on HTML form via php, js

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am using php to create a HTML form to edit some MySQL results.

I want to be able to select a date from a calendar, so I found a nice
calendar pop JavaScript.

Problem I am having is that the results from the query and thus to be
modified by the form can generate some long pages, ie: one results set
right now is 282 records. Paging is not an option, as the user(s) do NOT
want it spread over multiple pages.

These leads to the calendar always being shown at the very TOP of the page.
So if your at the 282th record, you would have to scroll all the way back
to the top. The problem is that the JavaScript always thinks its at the
time top of the page.

I passing a count and then using a formula to move things down, and to a
point it works, but not as reliable as I would like.

Is there some better way to get the x,y location of where the field has been
drawn on the page/screen.

l = dest.offsetLeft + dest.offsetParent.offsetLeft;
t = dest.offsetTop - 125;

I've played with t = to use a formula based on the number of the record like
t = (90*loc) -125; etc.... This after trial and error works to a point but
can still place the cal off the screen and require a scroll to find.

Is there a better way to get a RELIABLE x,y location to popup the calendar
when the screen is drawn via php loop.

The php loop that renders the form:

for($i=0; $i<$number; $i++)
                        echo "<TR>\n";
                        echo "\t<TD><input type=\"text\" name=\"inspReqID$i\"
VALUE=\"$InspID[$i]\" size=\"8\" readonly=\"readonly\"></TD>";
                        echo "\t<TD
$InspCity[$i] $Inspzip[$i]</TD>";
                        echo "\t<TD align=\"center\">$InspDays[$i]</TD>";
                        echo "\t<TD><select name=\"status$i\" VALUE=\"\"><option
value=\"\"></option><option value=\"TD\">TD</option><option
value=\"M\">M</option><option value=\"Other\">Other</option><option
value=\"Rural\">Rural</option><option value=\"Gated\">Gated</option><option
                         echo "\t<td><input type=\"text\" value=\"Select Date\"
name=\"SelectedDate$i\" id=\"SelectedDate$i\" readonly=\"readonly\"
size=\"10\" onClick=\"GetDate(this, $i);\">";
                        echo "\t<TD><textarea rows=\"3\" cols=\"25\"
                        echo "</TR>\n";



Re: calendar popup on HTML form via php, js wrote:
Quoted text here. Click to load it

Is it that you want to pop up the calendar next to one of the
table blocks and not at the top of the page ?

Site Timeline