Revision 285

Date:
2013/02/26 20:34:58
Author:
ahitrov
Revision Log:
Date check on form submit
Files:

Legend:

 
Added
 
Removed
 
Modified
  • koi8/core/comps/contenido/components/obj_list_js.msn

     
    120 120 % }
    121 121 }
    122 122
    123 function Save()
    123 function Save( oForm )
    124 124 {
    125 125 for (var i = 0; i < ObjLists.length; i++)
    126 126 {
     
    138 138 document.form.obj_list_dest_id[i].selected = true;
    139 139 }
    140 140 }
    141 var Check_day;
    142 var Check_mon;
    143 var Check_year;
    144 % foreach my $prop ( $object->structure ) {
    145 % if ( !($prop->{hidden} || $prop->{readonly} || $prop->{auto}) && ($prop->{type} eq 'datetime' || $prop->{type} eq 'date') ) {
    146 % my $name = $prop->{attr};
    147 Check_day = oForm.<% $name %>_day.value;
    148 Check_mon = oForm.<% $name %>_month.value;
    149 Check_year = oForm.<% $name %>_year.value;
    150 if ( ((Check_mon == 4 || Check_mon == 6 || Check_mon == 9 || Check_mon == 11) && Check_day > 30) ||
    151 (Check_year % 4 > 0 && Check_mon == 2 && Check_day > 28) || (Check_year % 4 == 0 && Check_mon == 2 && Check_day > 29) ) {
    152 alert('���� [<% $prop->{attr} %>] ������� �������');
    153 oForm.<% $name %>_day.focus();
    154 return false;
    155 }
    156 % }
    157 % }
    141 158
    142 159 return true;
    143 160 }
  • koi8/core/comps/contenido/components/object_form.msn

     
    1 1 <!-- ����� ��� �������������� ������� -->
    2 2 <a name="top"></a>
    3 <form enctype="multipart/form-data" action="<% $PROTOS->{$proto}->[1] %>" method="POST" name="form" onSubmit="javascript:Save()">
    3 <form enctype="multipart/form-data" action="<% $PROTOS->{$proto}->[1] %>" method="POST" name="form" onSubmit="return Save(this)">
    4 4 <table border="0" width="100%" cellspacing="0" cellpadding="6">
    5 5 <tr>
    6 6 <td style="font-size:110%;">