Good day. I'm using FF 3.0.5 and Chrome.

I'm generating validation script on server-side and embed it into page
before sending response to a client.
The problem is that  FireBug doesn't show JS error, but nothing
happens. Validation doesn't take place.
Please, see my page code. It is much bigger, but  I've shortened it.

Excuse me for native language, but they are just captions, they don't
play any significant role.
When I try to enter invalid data to field, nothing happens. Seems like
validation doesn't work at all. I can't understand why.

Please, help me or suggest some way to debug it. Thank you for your
attention

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
        <head>
                <meta http-equiv="content-type" content="text/html; 
charset=utf-8" /
>

                <link type="text/css" rel="stylesheet" media="screen" 
href="../css/
common.css" />
                <link type="text/css" rel="stylesheet" 
href="../css/flexbox.css" /
>

                <script type="text/javascript" src="../js/jquerylib/
jquery-1.3.1.min.js"></script>
                <script type="text/javascript" src="../js/jquerylib/
jquery.validate.pack.js"></script>

                <script type="text/javascript" src="../js/jquerylib/
jquery.flexbox.min.js"></script>
                <script type="text/javascript" src="../js/jquerylib/jquery-ui-
personalized-1.5.3.min.js"></script>
                <script type="text/javascript" 
src="../js/jquerylib/ui.datepicker-
ru.js"></script>
                <script type="text/javascript" src="../js/editui.js"></script>

                <script type="text/javascript">
                        var telephoneRowCount = parseInt("1") ;
                        var CitizenshipRowCount = parseInt("1") ;

                        //autocompleter
                        $(document).ready(function() {
                                //Citizenship autocompleter
                        $("#CitizenshipId").flexbox("GetCitizenships.action",{
                                showArrow: false,
                                width: 400,
                                minChars: 3,
                                onSelect: function() {
                                        addCitizenshipRow("citizenTbl", 
this.getAttribute
("hiddenValue"),this.value);
                                        
$("#CitizenshipId_input").attr("value","");
                                }
                        });
                        //validation
                        $("#submitForm").validate({ rules: {
                                                        "person.firstName": {
                                                                required: true,
                                                                maxLength : 30,
                                                                minLength : 1  
},
                                                        "person.lastName": {
                                                                required: true, 
maxLength : 30,
                                                                minLength : 1  
},
                                                        "person.citizenship": {
                                                                required: true,
                                                                maxLength : 2,
                                                                minLength : 1  
},
                                                        "person.sex": {
                                                                required: true,
                                                                max : 1.0,
                                                                min : 0.0  },
                                                        
"person.passportSeries": {
                                                                required: true,
                                                                maxLength : 30,
                                                                minLength : 1  
},
                                                        
"person.passportNumber": {
                                                                required: true,
                                                                minLength : 5  
},
                                                        
"person.passportIssueDate": {
                                                                required: true,
                                                                dateDE : true  
},
                                                        
"person.passportIssuePlace": {
                                                                required: true,
                                                                minLength : 10  
},
                                                        
"person.registrationAddress": {
                                                                required: true,
                                                                minLength : 10  
},
                                                        "person.factAddress": {
                                                                required: true,
                                                                minLength : 10  
},
                                                        },
                                                messages: {
                                                        "person.firstName": {
                                                                
required:"введите имя",
                                                                maxLength :
                                                        "введите имя",
                                                                minLength : 
"введите имя" },
                                                        "person.lastName": {
                                                                
required:"введите фамилию",
                                                                maxLength : 
"введите фамилию",
                                                                minLength : 
"введите фамилию" },
                                                        "person.citizenship": {
                                                                
required:"выберите гражданство",
                                                                maxLength : 
"выберите гражданство",
                                                                minLength : 
"выберите гражданство" },
                                                        "person.sex": {
                                                                
required:"выберите пол",
                                                                max : "выберите 
пол", min : "выберите пол" },
                                                        
"person.passportSeries": {
                                                                
required:"введите серию паспорта",
                                                                maxLength : 
"введите серию паспорта",
                                                                minLength : 
"введите серию паспорта" },
                                                        
"person.passportNumber": {
                                                                
required:"введите номер паспорта",
                                                                minLength : 
"введите номер паспорта" },
                                                        
"person.passportIssueDate": {
                                                                
required:"введите дату выдачи паспорта",
                                                                dateDE : 
"введите дату выдачи паспорта" },
                                                        
"person.passportIssuePlace": {
                                                                
required:"введите кем выдан паспорт",
                                                                minLength : 
"введите кем выдан паспорт" },
                                                        
"person.registrationAddress": {
                                                                
required:"введите адрес регистрации",
                                                                minLength : 
"введите адрес регистрации" },
                                                        "person.factAddress": {
                                                                
required:"введите фактический адрес проживания",
                                                                minLength : 
"введите фактический адрес проживания" }
                                                }
                                        });
                    });

                    //datepicker
                    $(function() {
                                $("#datepickerBirth").datepicker();
                                $("#datepickerPassportIssue").datepicker();
                        });
                </script>
        </head>
        <body>
        <div style="padding: 10px 20px 20px 20px;">

        <form id="submitForm" action="editor/StorePerson.action"
method="post" >
        <input type="hidden" name="validation.type"/>
        <input type="hidden" name="person.personId"/>

        <table><!-- Person and passport -->
                <tr valign="top">
                        <td>
                                <table> <!-- Person table -->
                                        <tr>
                                                <td class="field" 
id="personlastName"> Фамилия </td>
                                                <td  class="value"> <input 
type="text" class="standard"
name="person.lastName" size="20"/> </td>

                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personfirstName"> Имя </td>
                                                <td class="value"> <input 
type="text" class="standard"
name="person.firstName"/> </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personpatronymic"> Отчество </td>

                                                <td class="value"> <input 
type="text" class="standard"
name="person.patronymic"/> </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personsex"> Пол </td>
                                                <td class="value">
                                                        <table>
                                                                <tr >


                                                                                
<td class="man"
                                                                                
        >

                                                                                
        <input type="radio" name="person.sex"
                                                                                
                   value="1"
                                                                                
        />
                                                                                
        М&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                </td>

                                                                                
<td
                                                                                
        class="woman">

                                                                                
        <input type="radio" name="person.sex"
                                                                                
                   value="0"
                                                                                
        />
                                                                                
        Ж&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                </td>

                                                                </tr>

                                                        </table>
                                                </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personbirthday"> Дата рождения </td>
                                                <td class="value"> <input 
type="text" name="person.birthday"
id="datepickerBirth"/> </td>
                                        </tr>

                                        <tr>
                                                <td class="field" 
id="personbirthPlace"> Место рождения </td>
                                                <td class="value"> <input 
type="text" class="standard"
name="person.birthPlace"/> </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personinn"> ИНН </td>

                                                <td class="value"> <input 
type="text" class="standard"
name="person.inn"/> </td>
                                        </tr>

                                        <tr>
                                                <td class="field" 
id="personconvictions"> Информация о судимости
</td>
                                                <td class="value"> <textarea 
name="person.convictions"></
textarea> </td>

                                        </tr>
                                        <tr>
                                                <td class="field"> Комментарий 
к записи о физическом лице </td>
                                                <td class="value"> <textarea 
name="person.commentary"></
textarea> </td>
                                        </tr>
                                </table>

                        </td>
                        <td>
                                <table><!-- Passport, education, citizenship, 
telephones -->
                                        <tr>
                                                <td class="field" 
id="personpassportSeries"> Серия </td>
                                                <td class="value"> <input 
type="text" class="standard"
name="person.passportSeries"/> </td>
                                        </tr>

                                        <tr>
                                                <td class="field" 
id="personpassportNumber"> Номер </td>
                                                <td class="value"> <input 
type="text" class="standard"
name="person.passportNumber"/> </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personpassportIssueDate"> Дата выдачи </
td>

                                                <td class="value"> <input 
type="text"
id="datepickerPassportIssue" name="person.passportIssueDate"/> </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personpassportIssuePlace"> Кем выдан </td>
                                                <td class="value"> <input 
type="text" class="standard"
name="person.passportIssuePlace"/> </td>
                                        </tr>

                                        <tr>
                                                <td class="field" 
id="personregistrationAddress"> Адрес прописки
</td>
                                                <td class="value"> <input 
type="text" class="standard"
name="person.registrationAddress"/> </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personfactAddress"> Место проживания </td>

                                                <td class="value"> <input 
type="text" class="standard"
name="person.factAddress"/> </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personeducationType"> Тип образования </
td>
                                                <td class="value">
                                                        <select 
name="person.educationType">

                                                                        <option 
value="204"> Высшее специальное </option>


                                                                        <option 
value="205"> Высшее </option>

                                                                        <option 
value="206"> Среднее специальное </option>

                                                                        <option 
value="207"> Среднее </option>

                                                                        <option 
value="332"> Нет данных </option>

                                                        </select>

                                                </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personcitizenship"> Гражданства </td>
                                                <td class="value">
                                                                                
<div id="CitizenshipId"></div>
                                                                                
<table id="citizenTbl">
                                                                                
        <tr class="citizenshipRow"> <td></td> <td></td> </tr>

                                                                                
</table>
                                                </td>
                                        </tr>
                                        <tr>
                                                <td class="field" 
id="personphoneNumber"> Телефоны </td>
                                                <td class="value">
                                                        <table 
id="PhoneNumberTbl"><!-- PhoneNumber control table -->
                                                                <tr 
style="font-size:80%; text-align:center; color:#8F8F8F;">

                                                                        <th 
colspan="2">
                                                                                
Код страны
                                                                        </th>
                                                                        <th>
                                                                                
города
                                                                        </th>
                                                                        <th>
                                                                                
номер телефона
                                                                        </th>

                                                                </tr>

                                                                <tr 
id="PhoneNumberRow1">
                                                                        <td> 
<input type="hidden" name="person.phoneNumber"/> </td>
                                                                        <td> 
+&nbsp;<input type="text" class="short" name="country"
size="5" onblur="concatPhoneNumber('PhoneNumberRow1')"/> &nbsp;</td>
                                                                        <td> 
<input type="text" class="short" name="city" size="5"
onblur="concatPhoneNumber('PhoneNumberRow1')"/> &nbsp;</td>
                                                                        <td> 
<input type="text" class="medium" name="num" size="10"
onblur="concatPhoneNumber('PhoneNumberRow1')"/> &nbsp;</td>

                                                                        <td> 
</td>
                                                                </tr>
                                                        </table>
                                                        <img 
src="../img/add.png" onclick="addPhoneNumberRow
('PhoneNumberTbl')"/> добавить еще один
                                                </td>
                                        </tr>
                                </table>
                        </td>

                </tr>
        </table>
        <input type="submit" value="Сохранить персону и отобразить на
тестовой странице" />
        </form>
        </div>
        </body>
</html>

Reply via email to