Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: calendar with array of elements
ywh
Junior Member

Posts: 3
Registered: 9/2/2008
Member Is Offline
posted on 9/2/2008 at 06:44 PM Reply With Quote
calendar with array of elements


I have the calendar3 working if I select one record (row).
If there are more than one row, each row has a calendar by the date box. I got "Error calling the calendar: prrameter specificed is not valid target control." The calendar won't pop-up. Thanks for any help.

.....my date field......
<input type="text" size="10" name="checkin_dates[]" value="'.$query['ro_checkin'].'" readonly="readonly"><a href="javascript:cal6.popup();"><img src="images/calendar/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a>

......script after the </form>......
echo '<script language="JavaScript">'.'var cal6 = new calendar3(document.forms['userform'].elements'checkin_dates[]']);'. 'cal6.year_scroll = false;'.'cal6.time_comp = false;'.'</script>';
View User's Profile View All Posts By User U2U Member
ywh
Junior Member

Posts: 3
Registered: 9/2/2008
Member Is Offline
posted on 9/3/2008 at 11:47 AM Reply With Quote

Just a note,
My date field is inside the loop:
if ($result && mysql_num_rows($result)) {
while($query = mysql_fetch_array($result)) {

My script is only called once in the end of the function after the </form>.
echo '<script language="JavaScript">'.
'var cal6 = new calendar3(document.forms[\'userform\'].elements[\'checkin_dates[]\']);'.
'cal6.year_scroll = false;'.
'cal6.time_comp = false;'.
'</script>';

I am not sure if elements[\'checkin_dates[]\'] is the correct syntax. It works for submitting one record, but not multiple records.
View User's Profile View All Posts By User U2U Member
ywh
Junior Member

Posts: 3
Registered: 9/2/2008
Member Is Offline
posted on 9/19/2008 at 01:49 PM Reply With Quote

I was able to get it to work for multiple calendars on a page and each has a reset date icon.
I would rather have the reset icon on the calendar.html, but for now, the below does what I need.

$rows=0;
echo "<form name='userform' method='POST' action='checkin.php'>";
//table starts here, not show the detailed code
if ($result && mysql_num_rows($result)) {
while($query = mysql_fetch_array($result)) {
.
.
$query['name'].'|'.
'|<input type="text" size="10" id='.$rows.' name="checkin_dates['.$rows.']" value="'.$query['checkin'].'" readonly="readonly"><a href="javascript:cal'.$rows.'.popup();"><img src="images/calendar/cal.gif" width="16" height="16" border="0" alt="Click here to select the date"></a><img src="images/calendar/reset.gif" onclick="document.getElementById(\''.$rows.'\').value=\'\'" alt="Clear date">'.
$query['comments']');

$rows++;
}
}
//table ends here
echo "</form>";

for ($i=0; $i<$rows; $i++) {
echo '<script language="JavaScript">'.
'var cal'.$i.' = new calendar3(document.forms[\'userform\'].elements[\'checkin_dates['.$i.']\']);'.
'cal'.$i.'.year_scroll = false;'.
'cal'.$i.'.time_comp = false;'.
'</script>';
}
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Calendar
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 
Tigra Calendar PRO
Product Demonstrations Live Demos
Popup Calendar
Onpage Calendar
Modal Calendar
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004