Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 435529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:23:07+00:00 2026-05-12T20:23:07+00:00

I downloaded the xVal sample project from Steve Sanderson’s blog , run it, and

  • 0

I downloaded the xVal sample project from Steve Sanderson’s blog, run it, and the sever side validation it’s working (after i click submit), but the client side doesn’t;
although i looked at the source and saw the generated javascript

<script type="text/javascript">xVal.AttachValidator("booking", {"Fields":[{"FieldName":"ClientName","FieldRules":[{"RuleName":"Required","RuleParameters":{}},{"RuleName":"StringLength","RuleParameters":{"MaxLength":"3"}}]},{"FieldName":"NumberOfGuests","FieldRules":[{"RuleName":"Range","RuleParameters":{"Min":"1","Max":"20","Type":"decimal"}},{"RuleName":"DataType","RuleParameters":{"Type":"Integer"}}]},{"FieldName":"ArrivalDate","FieldRules":[{"RuleName":"DataType","RuleParameters":{"Type":"Date"}},{"RuleName":"Required","RuleParameters":{}}]}]})</script>

my view code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="CreateBooking.aspx.cs" Inherits="BookingsDemo.Views.Home.CreateBooking" %>
<%@ Import Namespace="DomainModel"%>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Place a booking</h1>

    <% using(Html.BeginForm()) { %>
        <div>
            Your name: <%= Html.TextBox("booking.ClientName") %>
            <%= Html.ValidationMessage("booking.ClientName") %>
        </div>
        <div>
            Number of guests: <%= Html.TextBox("booking.NumberOfGuests")%>
            <%= Html.ValidationMessage("booking.NumberOfGuests")%>
        </div>
        <div>
            Expected arrival date: <%= Html.TextBox("booking.ArrivalDate")%>
            <%= Html.ValidationMessage("booking.ArrivalDate")%>
        </div>                
        <input type="submit" />       
    <% } %>
    <%= Html.ClientSideValidation<Booking>("booking") %>    
</asp:Content>

here is the generated html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>

</title><link href="../Content/Site.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="/Scripts/jquery-1.2.6.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/xVal.jquery.validate.js"></script>
</head>

<body>
    <div class="page">

        <div id="header">
            <div id="title">
            </div>

            <div id="menucontainer">


            </div>
        </div>

        <div id="main">

    <h1>Place a booking</h1>
    <form action="/Home/CreateBooking" method="post">
        <div>
            Your name: <input id="booking_ClientName" name="booking.ClientName" type="text" value="" />

        </div>
        <div>
            Number of guests: <input id="booking_NumberOfGuests" name="booking.NumberOfGuests" type="text" value="" />


        </div>
        <div>
            Expected arrival date: <input id="booking_ArrivalDate" name="booking.ArrivalDate" type="text" value="" />

        </div>                

        <input type="submit" />       
    </form><script type="text/javascript">xVal.AttachValidator("booking", {"Fields":[{"FieldName":"ClientName","FieldRules":[{"RuleName":"Required","RuleParameters":{}},{"RuleName":"StringLength","RuleParameters":{"MaxLength":"15"}}]},{"FieldName":"NumberOfGuests","FieldRules":[{"RuleName":"Range","RuleParameters":{"Min":"1","Max":"20","Type":"decimal"}},{"RuleName":"DataType","RuleParameters":{"Type":"Integer"}}]},{"FieldName":"ArrivalDate","FieldRules":[{"RuleName":"DataType","RuleParameters":{"Type":"Date"}},{"RuleName":"Required","RuleParameters":{}}]}]})</script>


            <div id="footer">
                My Sample MVC Application &copy; Copyright 2008
            </div>

        </div>
    </div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:23:07+00:00Added an answer on May 12, 2026 at 8:23 pm

    the client side validation doesn’t work in the demo downloaded from that blog,
    but with the new versions of jquery and xVal everything works fine 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded a project from TouchMyPixel and when I try to run it with
I downloaded a sample project from net when I opened it its object library
I downloaded example code of an Android project featuring AdMob ads from here .
Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having
I downloaded Android's Browser project (from git) and imported it to Eclipse. I cannot
I downloaded a sample from https://github.com/ResultsDirect/LinkedIn-iPhone . The sample works fine, but I need
Downloaded Reachability from Apple, using this method to check for an active connection: -(BOOL)isReachable{
I downloaded and edited a code that from internet, basically what I want to
I downloaded Mono software (http://xamarin.com/monoforandroid) and the samples from the xamarin website (http://samples.xamarin.com/Android). When
Downloaded Facebook C# SDK 5.4.1 from here . I've been through the CS-WinForms solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.