diff --git a/.changeset/wise-knives-smash.md b/.changeset/wise-knives-smash.md
new file mode 100644
index 00000000000..717c94f08c9
--- /dev/null
+++ b/.changeset/wise-knives-smash.md
@@ -0,0 +1,5 @@
+---
+"@wso2is/identity-apps-core": patch
+---
+
+Fix input field value retention issue in self-registration form
diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp
index 3f7e8b12177..422bafe8fb8 100644
--- a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp
+++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp
@@ -404,8 +404,9 @@
required <%}%>
- <% if (skipSignUpEnableCheck && StringUtils.isNotEmpty(firstNameValue)) { %>
- value="<%= Encode.forHtmlAttribute(firstNameValue)%>" disabled <% } %>
+ <% if (skipSignUpEnableCheck && StringUtils.isNotEmpty(firstNameValue)) { %> disabled <% } %>
+ <% if (StringUtils.isNotEmpty(firstNameValue)) { %>
+ value="<%= Encode.forHtmlAttribute(firstNameValue)%>"<% } %>
placeholder="<%=IdentityManagementEndpointUtil.i18n(recoveryResourceBundle, "First.name")%>*"/>
@@ -423,8 +424,9 @@
required <%}%>
- <% if (skipSignUpEnableCheck && StringUtils.isNotEmpty(lastNameValue)) { %>
- value="<%= Encode.forHtmlAttribute(lastNameValue)%>" disabled <% } %>
+ <% if (skipSignUpEnableCheck && StringUtils.isNotEmpty(lastNameValue)) { %> disabled <% } %>
+ <% if (StringUtils.isNotEmpty(lastNameValue)) { %>
+ value="<%= Encode.forHtmlAttribute(lastNameValue)%>"<% } %>
placeholder="<%=IdentityManagementEndpointUtil.i18n(recoveryResourceBundle, "Last.name")%>*"
/>
@@ -630,8 +632,9 @@
<% if (claim.getRequired()) { %>
required
<% }%>
- <% if(skipSignUpEnableCheck && StringUtils.isNotEmpty(claimValue)) {%>
- value="<%= Encode.forHtmlAttribute(claimValue)%>" disabled<%}%>
+ <% if (skipSignUpEnableCheck && StringUtils.isNotEmpty(claimValue)) {%> disabled <%}%>
+ <% if (StringUtils.isNotEmpty(claimValue)) {%>
+ value="<%= Encode.forHtmlAttribute(claimValue)%>"<%}%>
/>
Enter Country
@@ -653,8 +656,10 @@
name="<%= Encode.forHtmlAttribute(claimURI) %>"
id="birthOfDate"
placeholder="Enter Birth Date"
- <% if(skipSignUpEnableCheck && StringUtils.isNotEmpty(claimValue)) {%>
- value="<%= Encode.forHtmlAttribute(claimValue)%>" disabled<%}%>
+ <% if (skipSignUpEnableCheck && StringUtils.isNotEmpty(claimValue)) {%>
+ disabled<% } %>
+ <% if (StringUtils.isNotEmpty(claimValue)) { %>
+ value="<%= Encode.forHtmlAttribute(claimValue)%>"<% } %>
/>
@@ -675,8 +680,10 @@
placeholder="<%=IdentityManagementEndpointUtil.i18nBase64(
recoveryResourceBundle, claim.getDisplayName())%>"
<% }%>
- <% if(skipSignUpEnableCheck && StringUtils.isNotEmpty(claimValue)) {%>
- value="<%= Encode.forHtmlAttribute(claimValue)%>" disabled<%}%>
+ <% if (skipSignUpEnableCheck && StringUtils.isNotEmpty(claimValue)) {%>
+ disabled<% } %>
+ <% if (StringUtils.isNotEmpty(claimValue)) { %>
+ value="<%= Encode.forHtmlAttribute(claimValue)%>"<% } %>
/>
<% } %>