Questions tagged [client-side-validation]

If the user is working with a browser that supports dynamic HTML (DHTML), Validation can perform validation using client script. It can provide immediate feedback without a round trip to the server

512 questions
5
votes
1 answer

Integrate Client-side Validation

EDIT contacted the author of play-js-validation. Bleeding edge stuff; Play has to be compiled against scala virtualized on to-be-released 2.10, and nested case classes are not yet supported. Really impressive project, I hope it comes to fruition as…
virtualeyes
  • 11,147
  • 6
  • 56
  • 91
4
votes
1 answer

Catch Client Side Validation failure

I've got a form that I'm submitting based on a div click. I also have it launching a waiting indicator when clicked. I'm trying to find out if there is a way to detect if client side validation failed or not so that I can remove the waiting…
Jared
  • 5,840
  • 5
  • 49
  • 83
4
votes
5 answers

What's the recommended way to display errors from JavaScript (jQuery) in ASP.NET MVC 3 views?

I submit a form to my ASP.NET MVC 3 server through a JavaScript handler (I use jQuery), and receive error responses from the server in another JavaScript handler. What I'm wondering is how I should display error messages, resulting from the form…
aknuds1
  • 65,625
  • 67
  • 195
  • 317
4
votes
1 answer

Django: Avoiding Server-Side and Client-Side Validation Code Duplication

How do you avoid duplicating validation code on the server-side and on the client-side with Django? Given that Django follows a Don't Repeat Yourself principle, it seems logical that there would be a way to do this, but I have no idea how.
4
votes
1 answer

How to set up Client side validation for a custom RequiredIf attribute for Asp.NET Core 3.0

I was not able to get my client side validation method to fire after setting up the validation according to various sources. After lots of struggle I found that changing the order of when the scripts were loaded resolved the issue. I have provided…
4
votes
2 answers

Client-side validation for custom ValidationAttribute with AttributeTargets.Class

Is it possible to implement client-site validation for custom ValidationAttribute, which is used in Class scope? For example my MaxLengthGlobal, which should assure global max limit for all input…
4
votes
2 answers

Unobtrusive Javascript Validation is non-functional without a Jquery script reference in the View

For some context, the DOM Hierarchy: Layout.cshtml > View > Partial View The Layout file contains: @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/jqueryui")
@RenderBody() …
4
votes
1 answer

Validate MVC field at client side

I have problem validating one field at client side, Here is my code: Model: public class Registration { public int Id { get; set; } [IsUserExistAttribute(ErrorMessage = "Email already exists!")] …
Just code
  • 13,553
  • 10
  • 51
  • 93
4
votes
2 answers

Using a html.validationmessagefor for a client side error message

I have server side validation messages for some of my text fields. The field 'title' is a required field server side with a '[Required]' data attribute in the class, but this only seems to get checked on a postback or form submit. I'm saving the…
chuckd
  • 13,460
  • 29
  • 152
  • 331
4
votes
3 answers

Replace default client side validation by custom one in ASP.NET MVC

I have a view model containing a DateTime property, for which I want to provide a text box using using a custom format (only month and year, "MM.YYYY"): public class MyModel { public DateTime? DateField {get; set;} } Formatting the value for the…
4
votes
1 answer

Client_side_validations gem not working in rails 3.2.13

I've spent quite a while trying to get client_side_validations gem to work, but no text is showing up and no script tags are being injected after the forms. I have tried it with both the standard form generated by Rails and a Devise form. I have…
4
votes
1 answer

rails client_side_validations and select tag

The gem client_side_validations doesn`t validate select tag with no item selected. Maybe need to pass some params in model or .erb file?
Egor Malkevich
  • 1,516
  • 1
  • 11
  • 24
4
votes
2 answers

Performing client-side validation in MVC4 View against ViewModel

I would like to know what is the best approach to handle client-side, javascript or jQuery driven validation of MVC4 fields against attributes placed on a ViewModel's fields. First, let's pick the example. A login creation screen for Administrators…
4
votes
2 answers

xVal in MVC.NET with nHibernate.validator does not fire client validation

I have an ASP.NET MVC Project working with NHibernate and NHibernate.Validator and i'd like to use xVal 1.0 (most recent release). I Added the requested scripts to the project and referenced it in Site.Master: