Opened 9 years ago

Closed 7 years ago

#5888 closed bug (invalid)

multiple datepicker with yearRang option set in one form causes error

Reported by: JMW1 Owned by: JMW1
Priority: minor Milestone: 1.11.0
Component: ui.datepicker Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description

I use the datepicker in multiple sections of one form. Within the head area of the site i initialize the datepicker for the class datepicker. Afterwards before the specified inputfields willbe generated in the code i implement a small js section which sets the yearRange option for the specified id.What now happen, is that the first datepicker get the correct parms and show the decided yearRange but the second one show up with standard range ('option', 'yearRange', 'c-10:c+10').

I wasn't able to find an error in my code thats why i guess it depends on the datepicker plugin itself.

Below the code snippets i use.

Here jquery will be initiated and the default values for all datepicker will be set:

//----------------------------------------------------------------------- jQuery
$RET .=
      '<link type="text/css" href="' .
      '../js/jquery/css/smoothness2/jquery-ui-1.8.2.custom.css" '.
      'rel="stylesheet" />' .
      '<script type="text/javascript" src="' .
      '../js/jquery/js/jquery-1.4.2.min.js"></script>' .
      '<script type="text/javascript" ' .
      'src="../js/jquery/js/jquery-ui-1.8.2.custom.min.js"></script>';
//------------------------------------------------------- jQuery Datepicker init
$RET .=
   "<script type='text/javascript'>" .
      "$(document).ready(function() {" .
         "$('.datepicker').datepicker({" .
            "changeMonth: true," .
            "changeYear: true" .
         "});";
if ($RP['l'] == "de"): //---------------------------------------- Language Check
	  $RET .=
	     "$('.datepicker').datepicker('option', 'dayNames', " .
	     "['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag'," .
	     "'Samstag']);" .
	     "$('.datepicker').datepicker('option', 'dayNamesMin', " .
	     "['So','Mo','Di','Mi','Do','Fr','Sa']);" .
	     "$('.datepicker').datepicker('option', 'monthNames', " .
	     "['J&auml;nner','Februar','M&auml;rz','April','Mai','Juni','Juli'," .
	     "'August','September','Oktober','November','Dezember']);" .
	     "$('.datepicker').datepicker('option', 'monthNamesShort', " .
	     "['J&auml;n','Feb','M&auml;r','Apr','Mai','Jun','Jul','Aug','Sep'," .
	     "'Okt','Nov','Dez']);" .
       "$('.datepicker').datepicker('option', 'firstDay', 1 );";
endif;
$RET .=
         "$('.datepicker').datepicker('option', 'dateFormat', 'yy-mm-dd');" .
      "});" .
   "</script>";

Here's the part which is setting parms for the following datpicker:

//==============================================================================
function sc_DatePicker //----------------------------------------- sc_DatePicker
         ($pNAME, $pDATE, $pWIDTH, $pYRANGE) {
global $SCJQ;
//==============================================================================
return
( "<script type='text/javascript'>"
.    "$(document).ready(function() {"
.       "$('#$pNAME').datepicker('option', 'yearRange', '$pYRANGE' );"
.       "$('#$pNAME').datepicker('setDate', '$pDATE');"
.    "});"
. "</script>"
. "<td class='Td_Memo' style='width:$pWIDTH;'>"
.    "<input name='$pNAME' type='text' style='width:$pWIDTH;' "
.    "maxlength='10' class='datepicker' id='$pNAME' >"
. "</td>"
);
} //---------------------------------------------------- sc_DatePicker ***END***

and here is at least the function call in the form.

   //--------------------------------------------------------------- FL_ValiDate
   "<td class='Td_Memo' style='width:68px;text-align:right;'>$w2</td>" .
   sc_DatePicker('FL_ValiDate', $tempFolder['FL_ValiDate'], '94px', 'c-0:c+2') ."</tr><tr>" .
   //---------------------------------------------------------------- FL_ExpDate
   "<td class='Td_Memo' style='width:68px;text-align:right;'>$w3</td>" .
   sc_DatePicker('FL_ExpDate', $tempFolder['FL_ExpDate'], '94px', 'c-0:c+5') .
"</tr></table>";
//======================================================================= LINE 3

i hope the description is useful and that you can help me.

Many thanks forward.

Change History (3)

comment:1 Changed 7 years ago by Scott González

Milestone: TBD1.11.0

comment:2 Changed 7 years ago by mikesherov

Owner: set to JMW1
Status: newpending

Hi, thanks for contributing! You have lots of PHP code in this bug report. We can't effectively debug this issue unless we can see the generated output and resulting javascript that may be causing the issue. Please provide a valid test case for us. Thanks again!

comment:3 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.