META-INF.resources.country.details.jsp Maven / Gradle / Ivy
The newest version!
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
<%@ include file="/init.jsp" %>
<%
long countryId = ParamUtil.getLong(request, "countryId");
Country country = CountryLocalServiceUtil.fetchCountry(countryId);
%>
<%
int titleMaxLength = ModelHintsUtil.getMaxLength(CountryLocalization.class.getName(), "title");
%>
var form = document.getElementById(' fm');
if (form) {
var nameInput = form.querySelector('# name');
var titleInput = form.querySelector('# title');
if (nameInput && titleInput) {
var handleOnTitleInput = function (event) {
var value = event.target.value;
if (nameInput.hasAttribute('maxLength')) {
value = value.substring(0, nameInput.getAttribute('maxLength'));
}
nameInput.value = value;
};
titleInput.addEventListener(
'input',
Liferay.Util.debounce(handleOnTitleInput, 200)
);
}
}