Skip to content

Commit 0713a72

Browse files
committed
nopSolutions#2091 Validation fix for password protected pages with forms
1 parent 4604c77 commit 0713a72

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Presentation/Nop.Web/Views/Topic/TopicBlock.cshtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
$('#ph-topic-@Model.Id .topic-block-body').html(data.Body);
2727
$('#ph-password-@Model.Id').hide();
2828
$('#ph-topic-@Model.Id').show();
29+
//we need to re-run the validation plugin after the content is loaded after successful authentication
30+
$.validator.unobtrusive.parse('#ph-topic-@Model.Id');
2931
} else {
3032
$('#password-error-@Model.Id').text(data.Error).fadeIn("slow");
3133
$('#ph-password-@Model.Id #password-@Model.Id').select().focus();

src/Presentation/Nop.Web/Views/Topic/TopicDetails.cshtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
$('#ph-topic .page-body').html(data.Body);
5656
$('#ph-password').hide();
5757
$('#ph-topic').show();
58+
//we need to re-run the validation plugin after the content is loaded after successful authentication
59+
$.validator.unobtrusive.parse('#ph-topic');
5860
}
5961
else {
6062
$('#password-error').text(data.Error).fadeIn("slow");

0 commit comments

Comments
 (0)