From: guy.pyrzak%gmail.com <> Date: Fri, 5 Sep 2008 03:00:53 +0000 (+0000) Subject: Bug 448696 - "(edit)" links should focus the text box and select all text in them X-Git-Tag: bugzilla-3.2rc2~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f49ecaf7fb8f25ff33228099e677c20e140e990;p=thirdparty%2Fbugzilla.git Bug 448696 - "(edit)" links should focus the text box and select all text in them Patch By Guy Pyrzak r=mkanat, a=mkanat --- diff --git a/js/field.js b/js/field.js index 15b5d4f794..69f2eeba90 100644 --- a/js/field.js +++ b/js/field.js @@ -161,6 +161,12 @@ function hideEditableField( container, input, action, field_id, original_value ) function showEditableField (e, ContainerInputArray) { YAHOO.util.Dom.setStyle(ContainerInputArray[0], 'display', 'none'); YAHOO.util.Dom.setStyle(ContainerInputArray[1], 'display', 'inline'); + var inputs = YAHOO.util.Dom.get(ContainerInputArray[1]).getElementsByTagName('input') + if( inputs.length > 0) { + // focus on the first field, this makes it easier to edit + inputs[0].focus(); + inputs[0].select(); + } YAHOO.util.Event.preventDefault(e); }