Skip to content
Permalink
Browse files

[JENKINS-51816] Avoid the form to be sent when Enter is pressed.

  • Loading branch information...
varyvol committed Jun 8, 2018
1 parent 64e4679 commit fd7d1e383c5b157316e648f1b50bceb7d8130267
@@ -103,14 +103,21 @@ THE SOFTWARE.
</table>
</div>
<script>
$('root-url').focus();
var rootUrlField = $('root-url');

rootUrlField.focus();
rootUrlField.onkeydown = function(event) {
if (event.keyCode == 13){
event.preventDefault();
}
};

(function setInitialRootUrlFieldValue(){
var iframeUrl = window.location.href;
// will let the trailing slash in the rootUrl
var iframeRelativeUrl = 'setupWizard/setupWizardConfigureInstance';
var rootUrl = iframeUrl.substr(0, iframeUrl.length - iframeRelativeUrl.length);
// to keep only the root url
var rootUrlField = $('root-url');
rootUrlField.value = rootUrl
// to adjust the width of the input,
rootUrlField.size = Math.min(50, rootUrl.length);

0 comments on commit fd7d1e3

Please sign in to comment.
You can’t perform that action at this time.