Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- calendar popup on HTML form via php, js
August 31, 2009, 3:30 pm
rate this thread
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
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
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 "\t<TD><input type=\"text\" name=\"inspReqID$i\"
VALUE=\"$InspID[$i]\" size=\"8\" readonly=\"readonly\"></TD>";
echo "\t<TD align=\"center\">$InspDays[$i]</TD>";
echo "\t<TD><select name=\"status$i\" VALUE=\"\"><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\"