diff --git a/modules/multiauth/templates/selectsource.php b/modules/multiauth/templates/selectsource.php
index 39a09c72b4f88b796160663ad81296de469245a7..1f16f31a77541f529c6bc4196a34be135e132f72 100644
--- a/modules/multiauth/templates/selectsource.php
+++ b/modules/multiauth/templates/selectsource.php
@@ -19,11 +19,10 @@ foreach($this->data['sources'] as $source) {
 	} else {
 		$autofocus = '';
 	}
-	echo '<button type="submit" name="source"' . $autofocus . ' ' .
+	$name = 'src-' . base64_encode($source['source']);
+	echo '<input type="submit" name="' . htmlspecialchars($name) . '"' . $autofocus . ' ' .
 		'id="button-' . htmlspecialchars($source['source']) . '" ' .
-		'value="' . htmlspecialchars($source['source']) . '">';
-	echo htmlspecialchars($this->t($source['text']));
-	echo '</button>';
+		'value="' . htmlspecialchars($this->t($source['text'])) . '" />';
 	echo '</li>';
 }
 ?>
diff --git a/modules/multiauth/www/selectsource.php b/modules/multiauth/www/selectsource.php
index 0f19cff3e67c3514ad2e004bb9e12ebcf5321407..329a1bf4909c26e82fedd3ee899da06d18ab12dd 100644
--- a/modules/multiauth/www/selectsource.php
+++ b/modules/multiauth/www/selectsource.php
@@ -26,13 +26,25 @@ if (array_key_exists("SimpleSAML_Auth_Default.id", $state)) {
 	$as = NULL;
 }
 
+$source = NULL;
 if (array_key_exists('source', $_REQUEST)) {
 	$source = $_REQUEST['source'];
+} else {
+	foreach ($_REQUEST as $k => $v) {
+		$k = explode('-', $k, 2);
+		if (count($k) === 2 && $k[0] === 'src') {
+			$source = base64_decode($k[1]);
+		}
+	}
+}
+if ($source !== NULL) {
 	if ($as !== NULL) {
 		$as->setPreviousSource($source);
 	}
 	sspmod_multiauth_Auth_Source_MultiAuth::delegateAuthentication($source, $state);
-} elseif (array_key_exists('multiauth:preselect', $state)) {
+}
+
+if (array_key_exists('multiauth:preselect', $state)) {
 	$source = $state['multiauth:preselect'];
 	sspmod_multiauth_Auth_Source_MultiAuth::delegateAuthentication($source, $state);
 }