diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php
index f901ed143182975d8e73105110dc6b78381c14a2..9e155be88c9ab074f4d47c135bbb06e156079642 100644
--- a/htdocs/core/tpl/passwordforgotten.tpl.php
+++ b/htdocs/core/tpl/passwordforgotten.tpl.php
@@ -88,14 +88,20 @@ if ($disablenofollow) echo '</a>';
 </tr>
 
 <?php
-if (! empty($hookmanager->resArray['options'])) {
-	foreach ($hookmanager->resArray['options'] as $format => $option)
-	{
-		if ($format == 'table') {
-			echo '<!-- Option by hook -->';
-			echo $option;
+if (! empty($morelogincontent)) {
+	if (is_array($morelogincontent)) {
+		foreach ($morelogincontent as $format => $option)
+		{
+			if ($format == 'table') {
+				echo '<!-- Option by hook -->';
+				echo $option;
+			}
 		}
 	}
+	else {
+		echo '<!-- Option by hook -->';
+		echo $morelogincontent;
+	}
 }
 ?>
 
@@ -175,6 +181,20 @@ if (! empty($hookmanager->resArray['options'])) {
 	</div>
 <?php } ?>
 
+<?php if (! empty($morelogincontent) && is_array($morelogincontent)) {
+	foreach ($morelogincontent as $format => $option)
+	{
+		if ($format == 'js') {
+			echo "\n".'<!-- Javascript by hook -->';
+			echo $option."\n";
+		}
+	}
+}
+else if (! empty($moreloginextracontent)) {
+	echo '<!-- Javascript by hook -->';
+	echo $moreloginextracontent;
+}
+?>
 
 </div>
 </div>	<!-- end of center -->
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 4efe56b0ac19bf17fc4490e653b5734d38f46f67..9c2aabd3654b830e9d1969893ed46d83e6d4dd58 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -224,10 +224,19 @@ if (function_exists("imagecreatefrompng") && ! $disabled)
 	$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
 }
 
-// Execute hook getPasswordForgottenPageOptions
-// Should be an array with differents options in $hookmanager->resArray
+// Execute hook getPasswordForgottenPageOptions (for table)
 $parameters=array('entity' => GETPOST('entity','int'));
 $hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters);    // Note that $action and $object may have been modified by some hooks
+if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
+	$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
+} else {
+	$morelogincontent = $hookmanager->resPrint;
+}
+
+// Execute hook getPasswordForgottenPageExtraOptions (eg for js)
+$parameters=array('entity' => GETPOST('entity','int'));
+$reshook = $hookmanager->executeHooks('getPasswordForgottenPageExtraOptions',$parameters);    // Note that $action and $object may have been modified by some hooks.
+$moreloginextracontent = $hookmanager->resPrint;
 
 include $template_dir.'passwordforgotten.tpl.php';	// To use native PHP