From b18458b1bd125a68e80aad051b5b2e0786fc9c33 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 29 Jan 2008 14:21:41 +0000
Subject: [PATCH] Set focus on the link/button which should be activated to go
 to the next page in debug mode.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@212 44740490-163a-0410-bde0-09ae8108e29a
---
 templates/default/en/httpredirect-debug.php | 5 ++++-
 templates/default/en/post-debug.php         | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/templates/default/en/httpredirect-debug.php b/templates/default/en/httpredirect-debug.php
index a3308cf63..508ad13e1 100644
--- a/templates/default/en/httpredirect-debug.php
+++ b/templates/default/en/httpredirect-debug.php
@@ -15,7 +15,10 @@
 		
 		<pre style="overflow: scroll; border: 1px solid #eee"><?php echo $data['message']; ?></pre>
 		
-		<p>[ <a href="<?php echo htmlentities($data['url']); ?>">send SAML message</a> ]</p>
+		<p>[ <a id="sendlink" href="<?php echo htmlentities($data['url']); ?>">send SAML message</a> ]</p>
+		<script type="text/javascript">
+			document.getElementById('sendlink').focus();
+		</script>
 
 		<h2>Debug mode</h2>
 		
diff --git a/templates/default/en/post-debug.php b/templates/default/en/post-debug.php
index 041422474..2228f63d0 100644
--- a/templates/default/en/post-debug.php
+++ b/templates/default/en/post-debug.php
@@ -16,9 +16,13 @@
 		<form method="post" action="<?php echo htmlspecialchars($data['destination']); ?>">
 			<input type="hidden" name="SAMLResponse" value="<?php echo htmlspecialchars($data['response']); ?>" />
 			<input type="hidden" name="<?php echo htmlspecialchars($data['RelayStateName']); ?>" value="<?php echo htmlspecialchars($data['RelayState']); ?>">
-			<input type="submit" value="Submit the response to the service" />
+			<input type="submit" value="Submit the response to the service" id="sendbutton" />
 		</form>
 
+		<script type="text/javascript">
+			document.getElementById('sendbutton').focus();
+		</script>
+
 		<h2>Debug mode</h2>
 		
 		<p>As you are in debug mode you are lucky to see the content of the response you are sending:</p>
-- 
GitLab