edit.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-empty"></div>
  4. <form id="goods_class_form" name="goodsClassForm" method="post">
  5. <input type="hidden" name="fleaclass_id" value="{$class_array.fleaclass_id}" />
  6. <table class="ds-default-table">
  7. <tbody>
  8. <tr class="noborder">
  9. <td colspan="2" class="required"><label class="fleaclass_name validation">{$Think.lang.goods_class_index_name}:</label></td>
  10. </tr>
  11. <tr class="noborder">
  12. <td class="vatop rowform"><input type="text" value="{$class_array.fleaclass_name}" name="fleaclass_name" id="fleaclass_name" class="txt"></td>
  13. <td class="vatop tips">{$Think.lang.goods_class_index_name}</td>
  14. </tr>
  15. <tr>
  16. <td colspan="2" class="required"><label>{$Think.lang.goods_class_index_display}:</label></td>
  17. </tr>
  18. <tr class="noborder">
  19. <td class="vatop rowform onoff"><label for="fleaclass_show1" class="cb-enable {if $class_array.fleaclass_show == '1'}selected{/if}"><span>{$Think.lang.ds_yes}</span></label>
  20. <label for="fleaclass_show0" class="cb-disable {if $class_array.fleaclass_show == '0'}selected{/if}"><span>{$Think.lang.ds_no}</span></label>
  21. <input id="fleaclass_show1" name="fleaclass_show" {if $class_array.fleaclass_show == '1'}checked="checked"{/if} value="1" type="radio">
  22. <input id="fleaclass_show0" name="fleaclass_show" {if $class_array.fleaclass_show == '0'}checked="checked"{/if} value="0" type="radio">
  23. </td>
  24. <td class="vatop tips">{$Think.lang.goods_class_add_display_tip}</td>
  25. </tr>
  26. <tr>
  27. <td colspan="2" class="required"><label>{$Think.lang.goods_class_index_display_in_homepage}:</label></td>
  28. </tr>
  29. <tr class="noborder">
  30. <td class="vatop rowform onoff"><label for="fleaclass_index_show1" class="cb-enable {if $class_array.fleaclass_show == '1'}selected{/if}"><span>{$Think.lang.ds_yes}</span></label>
  31. <label for="fleaclass_index_show0" class="cb-disable {if $class_array.fleaclass_index_show == '0'}selected{/if}"><span>{$Think.lang.ds_no}</span></label>
  32. <input id="fleaclass_index_show1" name="fleaclass_index_show" {if $class_array.fleaclass_index_show == '1'}checked="checked"{/if} value="1" type="radio">
  33. <input id="fleaclass_index_show0" name="fleaclass_index_show" {if $class_array.fleaclass_index_show == '0'}checked="checked"{/if} value="0" type="radio"></td>
  34. <td class="vatop tips">{$Think.lang.goods_class_add_display_tip}</td>
  35. </tr>
  36. <tr>
  37. <td colspan="2" class="required"><label for="fleaclass_sort">{$Think.lang.ds_sort}:</label></td>
  38. </tr>
  39. <tr class="noborder">
  40. <td class="vatop rowform"><input type="text" value="{$class_array.fleaclass_sort}" name="fleaclass_sort" id="fleaclass_sort" class="txt"></td>
  41. <td class="vatop tips">{$Think.lang.goods_class_add_update_sort}</td>
  42. </tr>
  43. </tbody>
  44. <tfoot>
  45. <tr class="tfoot"><td colspan="15" ><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  46. </tr>
  47. </tfoot>
  48. </table>
  49. </form>
  50. </div>
  51. {include file="public/footer" /}
  52. <script>
  53. $(document).ready(function(){
  54. $('#t_id').change(function(){
  55. if($(this).val() == '0'){
  56. $('#t_name').val('');
  57. }else{
  58. $('#t_name').val($(this).find('option:selected').text());
  59. }
  60. });
  61. $('#goods_class_form').validate({
  62. errorPlacement: function(error, element){
  63. error.appendTo(element.parent().parent().prev().find('td:first'));
  64. },
  65. rules : {
  66. fleaclass_name : {
  67. required : true,
  68. remote : {
  69. url :"{:url('Fleaclass/ajax',['branch'=>'check_class_name'])}",
  70. type:'get',
  71. data:{
  72. fleaclass_name : function(){
  73. return $('#fleaclass_name').val();
  74. },
  75. fleaclass_parent_id : function() {
  76. return $('#fleaclass_parent_id').val();
  77. },
  78. fleaclass_id : '{$class_array.fleaclass_id}'
  79. }
  80. }
  81. },
  82. fleaclass_sort : {
  83. number : true
  84. }
  85. },
  86. messages : {
  87. fleaclass_name : {
  88. required : '{$Think.lang.goods_class_add_name_null}',
  89. remote : '{$Think.lang.goods_class_add_name_exists}'
  90. },
  91. fleaclass_sort : {
  92. number : '{$Think.lang.goods_class_add_sort_int}'
  93. }
  94. }
  95. });
  96. });
  97. </script>