Bug 31410: Set focus for cursor to Server name when adding a new Z39.50/SRU server

This makes sure that the focus is in the first form field when
adding a new Z39.50 or SRU server.

To test:
* Administration > Z39.50/SRU servers
* Add a new server for each
* Verify the focus is not in the form
* Apply patch
* Verify the focus is now in the first form field
* Edit an existing server
* Verify the focus is not in the form

Not having the focus when editing is to avoid accidental changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2504a282b5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 71f20a1c35)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Katrin Fischer 2023-02-05 00:17:01 +00:00 committed by Lucas Gass
parent f9090a2858
commit ee095916fc
1 changed files with 6 additions and 1 deletions

View File

@ -95,7 +95,12 @@
<fieldset class="rows">
<ol>
<li><label for="name" class="required">Server name: </label>
<input type="text" name="servername" id="servername" size="65" maxlength="100" value="[% server.servername | html %]" required="required" /> <span class="required">Required</span>
[% IF server.servername %]
<input type="text" name="servername" id="servername" size="65" maxlength="100" value="[% server.servername | html %]" required="required" />
[% ELSE %]
<input type="text" name="servername" id="servername" class="focus" size="65" maxlength="100" value="[% server.servername | html %]" required="required" />
[% END %]
<span class="required">Required</span>
</li>
<li><label for="host" class="required">Hostname: </label> <input type="text" name="host" id="host" size="30" value="[% server.host | html %]" required="required" /> <span class="required">Required</span>