Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Requried message should be cleared Post selecting dropdown value . even after selecting dropdown value still it is displaying until we submit request.

<Required(ErrorMessage:="Required field")>
    Public Property StateId As Nullable(Of Integer)


What I have tried:

tried by using javascript but did not work.
Posted
Updated 21-Feb-19 10:05am
Comments
MadMyche 21-Feb-19 11:44am    
Please update the question to show the Rendered HTML as well as the JavaScript you are attempting to use to clear the message
Chinnu2020 21-Feb-19 11:58am    
i need to disable required message post selection dropdown value
MadMyche 21-Feb-19 14:30pm    
I know what you are asking for; BUT cannot help you without the code for the HTML element or the javascript you have tried to use

1 solution

I'm guessing your app is running on .NET Framework 4.x and very likely the appsetting is missing the following entry or it was set to false. Again, this is my assumption based on the description on your post. Since the client side validation was turn off / not available, the message will stay until after a successful post to the server.

HTML
<add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />


More reading:
Brad Wilson: Unobtrusive Client Validation in ASP.NET MVC 3[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900