? ? Pending

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
2 Mar 2017

Pull Request for Issue #14306 .

Summary of Changes

  • Restore the onChange property
  • Add an extra check that the field belongs to a form before attaching an on submit listener

Testing Instructions

Apply patch
Edit protostar template and insert somewhere inside the body:

<?php echo JHtml::_('calendar', JFactory::getDate()->format('Y-m-d'), 'date', 'date', '%Y-%m-%d', array('onChange' => "alert('it works')")); ?>

An alert with a message it works should appear each time you change the date in the calendar

Documentation Changes Required

None, this is a bug

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
1.00

avatar dgt41 dgt41 - open - 2 Mar 2017
avatar dgt41 dgt41 - change - 2 Mar 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Mar 2017
Category Libraries JavaScript
avatar chmst chmst - test_item - 2 Mar 2017 - Tested successfully
avatar chmst
chmst - comment - 2 Mar 2017

I have tested this item successfully on cc5773c

Tested successfully and thank you :) saves my life.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14311.

avatar chmst
chmst - comment - 2 Mar 2017

Can you give me a hint how to get rid of the time?
There should be a attribute "showtime='false'" but it also does not work


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14311.

avatar dgt41 dgt41 - change - 3 Mar 2017
Labels Added: ?
avatar dgt41
dgt41 - comment - 3 Mar 2017

Try this:

	<?php echo JHtml::_('calendar', JFactory::getDate()->format('Y-m-d'), 'date', 'date', '%Y-%m-%d', array(
			'onChange' => "alert('it works')",
			"showTime" => false,
			"todayBtn" => true,
			"weekNumbers" => false,
			"fillTable" => true,
			"singleHeader" => false,

	)); ?>
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 3 Mar 2017 - Tested unsuccessfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Mar 2017

I have tested this item ? unsuccessfully on e50b176

Insert <?php echo JHtml::_('calendar', JFactory::getDate()->format('Y-m-d'), 'date', 'date', '%Y-%m-%d', array('onChange' => "alert('it works')")); ?> in /index.php in template "protostar" after <div class="body" id="top"> (line 141) got:
bildschirmfoto 2017-03-03 um 08 18 40


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14311.
avatar dgt41
dgt41 - comment - 3 Mar 2017

@franz-wohlkoenig try in another position, e.g. inside the main after <main id="content" role="main" class="<?php echo $span; ?>">

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Mar 2017

@dgt41 same (position after Line 183 in index.php):
bildschirmfoto 2017-03-03 um 08 31 29

avatar dgt41
dgt41 - comment - 3 Mar 2017

@franz-wohlkoenig what is the problem, as the field renders successfully?

avatar dgt41 dgt41 - change - 3 Mar 2017
Labels Added: ?
avatar chmst
chmst - comment - 3 Mar 2017

@dgt41
thanks again, it works but with ' around the booleans

	$attribs = array(
			'onChange' => "alert('it works')",
			"showTime" => 'false',
			"todayBtn" => 'true',
			"weekNumbers" => 'false',
			"fillTable" => 'true',
			"singleHeader" => 'false',
		);
	echo JHtml::_('calendar', JFactory::getDate()->format('Y-m-d'), 'date', 'date', '%Y-%m-%d', $attribs); ?>

avatar infograf768
infograf768 - comment - 3 Mar 2017

Works fine here with

<?php echo JHtml::_('calendar', JFactory::getDate()->format('Y-m-d'), 'date', 'date', '%Y-%m-%d', array(
			'onChange' => "alert('it works')",
			"showTime" => false,
			"todayBtn" => true,
			"weekNumbers" => false,
			"fillTable" => true,
			"singleHeader" => false,

	)); ?>

screen shot 2017-03-03 at 08 55 38

avatar infograf768 infograf768 - test_item - 3 Mar 2017 - Tested successfully
avatar infograf768
infograf768 - comment - 3 Mar 2017

I have tested this item successfully on d0879d2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14311.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Mar 2017
avatar dgt41
dgt41 - comment - 3 Mar 2017

@chmst @infograf768 so do we need the quotes or not?

avatar dgt41
dgt41 - comment - 3 Mar 2017

@franz-wohlkoenig that is the expected result, to test try to change the date and see if you get a popup with the text it works

avatar chmst
chmst - comment - 3 Mar 2017

@dgt41 , @infograf768
see the screens (don't mind the css .. I'm working on it)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14311.

avatar infograf768
infograf768 - comment - 3 Mar 2017

@dgt41
I did not need the quotes here.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Mar 2017

@dgt41 ah, pop-up: i don't get them to work. So all fine as others tested successfully.

avatar infograf768
infograf768 - comment - 3 Mar 2017

@chmst

Which screens?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14311.

avatar chmst
chmst - comment - 3 Mar 2017

Strange, I need them: screen shot 2017-03-03 at 08 14 47screen shot 2017-03-03 at 08 14 47


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14311.

avatar wilsonge wilsonge - change - 3 Mar 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-03-03 12:48:21
Closed_By wilsonge
avatar wilsonge wilsonge - close - 3 Mar 2017
avatar wilsonge wilsonge - merge - 3 Mar 2017
avatar wilsonge
wilsonge - comment - 3 Mar 2017

Merged :)

Add a Comment

Login with GitHub to post a comment