123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- {include file="public/header" /}
- <div class="page">
- <div class="fixed-empty"></div>
- <form id="goods_class_form" method="post">
- <table class="ds-default-table">
- <tbody>
- <tr class="noborder">
- <td colspan="2" class="required"><label class="validation" for="fleaclass_name">{$Think.lang.goods_class_index_name}:</label></td>
- </tr>
- <tr class="noborder">
- <td class="vatop rowform"><input type="text" value="" name="fleaclass_name" id="fleaclass_name" class="txt"></td>
- <td class="vatop tips"></td>
- </tr>
- <tr>
- <td colspan="2" class="required"><label for="parent_id">{$Think.lang.goods_class_add_sup_class}:</label></td>
- </tr>
- <tr class="noborder">
- <td class="vatop rowform"><select name="fleaclass_parent_id" id="fleaclass_parent_id">
- <option value="0">{$Think.lang.ds_please_choose}...</option>
- {notempty name="parent_list"}
- {foreach name="parent_list" item="v"}
- <option {if $fleaclass_parent_id==$v.fleaclass_id}selected='selected'{/if} value="{$v.fleaclass_id}">{$v.fleaclass_name|raw}</option>
- {/foreach}
- {/notempty}
- </select></td>
- <td class="vatop tips">{$Think.lang.goods_class_add_sup_class_notice}</td>
- </tr>
- <tr>
- <td colspan="2" class="required"><label>{$Think.lang.ds_display}:</label></td>
- </tr>
- <tr class="noborder">
- <td class="vatop rowform onoff"><label for="fleaclass_show1" class="cb-enable selected"><span>{$Think.lang.ds_yes}</span></label>
- <label for="fleaclass_show0" class="cb-disable"><span>{$Think.lang.ds_no}</span></label>
- <input id="fleaclass_show1" name="fleaclass_show" checked="checked" value="1" type="radio">
- <input id="fleaclass_show0" name="fleaclass_show" value="0" type="radio"></td>
- <td class="vatop tips">{$Think.lang.goods_class_add_display_tip}</td>
- </tr>
- <tr>
- <td colspan="2" class="required"><label>{$Think.lang.goods_class_index_display_in_homepage}:</label></td>
- </tr>
- <tr class="noborder">
- <td class="vatop rowform onoff"><label for="fleaclass_index_show1" class="cb-enable selected"><span>{$Think.lang.ds_yes}</span></label>
- <label for="fleaclass_index_show0" class="cb-disable"><span>{$Think.lang.ds_no}</span></label>
- <input id="fleaclass_index_show1" name="fleaclass_index_show" checked="checked" value="1" type="radio">
- <input id="fleaclass_index_show0" name="fleaclass_index_show" value="0" type="radio"></td>
- <td class="vatop tips">{$Think.lang.goods_class_add_display_tip}</td>
- </tr>
- <tr>
- <td colspan="2" class="required"><label>{$Think.lang.ds_sort}:</label></td>
- </tr>
- <tr class="noborder">
- <td class="vatop rowform"><input type="text" value="255" name="fleaclass_sort" id="fleaclass_sort" class="txt"></td>
- <td class="vatop tips">{$Think.lang.goods_class_add_update_sort}</td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td colspan="2"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
- <script>
- //按钮先执行验证再提交表单
- $(function(){
- $('#t_id').change(function(){
- if($(this).val() == '0'){
- $('#t_name').val('');
- }else{
- $('#t_name').val($(this).find('option:selected').text());
- }
- });
- $('#goods_class_form').validate({
- errorPlacement: function(error, element){
- error.appendTo(element.parent().parent().prev().find('td:first'));
- },
- rules : {
- fleaclass_name : {
- required : true,
- remote : {
- url :"{:url('Fleaclass/ajax',['branch'=>'check_class_name'])}",
- type:'get',
- data:{
- fleaclass_name : function(){
- return $('#fleaclass_name').val();
- },
- fleaclass_parent_id : function() {
- return $('#fleaclass_parent_id').val();
- },
- fleaclass_id : ''
- }
- }
- },
- fleaclass_sort : {
- number : true,
- range:[0,255]
- }
- },
- messages : {
- fleaclass_name : {
- required : '{$Think.lang.goods_class_add_name_null}',
- remote : '{$Think.lang.goods_class_add_name_exists}'
- },
- fleaclass_sort : {
- number : '{$Think.lang.goods_class_add_sort_int}',
- range: '{$Think.lang.ds_range_0_255}'
- }
- }
- });
- });
- </script>
- {include file="public/footer" /}
|