form.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form id="navigation_form" method="post">
  4. <table class="ds-default-table">
  5. <tbody>
  6. <tr class="noborder">
  7. <td class="required w120"><label class="validation" for="nav_title">{$Think.lang.nav_title}</label></td>
  8. <td><input type="text" name="nav_title" id="nav_title" value="{$nav.nav_title|default=''}" class="w200"/></td>
  9. </tr>
  10. <tr class="noborder">
  11. <td>{$Think.lang.nav_url}</td>
  12. <td><input type="text" name="nav_url" id="nav_url" value="{$nav.nav_url|default=''}" class="w200"/></td>
  13. </tr>
  14. <tr class="noborder">
  15. <td class="required w120">{$Think.lang.nav_location}</td>
  16. <td>
  17. <label class="radio-label">
  18. <i class="radio-common {if $nav.nav_location == 'header'}selected{/if}">
  19. <input type="radio" value="header" name="nav_location" {if $nav.nav_location == 'header'}checked="checked""{/if}>
  20. </i>
  21. <span>{$Think.lang.nav_top}</span>
  22. </label>
  23. <label class="radio-label">
  24. <i class="radio-common {if $nav.nav_location == 'middle'}selected{/if}">
  25. <input type="radio" value="middle" name="nav_location" {if $nav.nav_location == 'middle'}checked="checked""{/if}>
  26. </i>
  27. <span>{$Think.lang.nav_midd}</span>
  28. </label>
  29. <label class="radio-label">
  30. <i class="radio-common {if $nav.nav_location == 'footer'}selected{/if}">
  31. <input type="radio" value="footer" name="nav_location" {if $nav.nav_location == 'footer'}checked="checked""{/if}>
  32. </i>
  33. <span>{$Think.lang.nav_foo}</span>
  34. </label>
  35. </td>
  36. </tr>
  37. <tr class="noborder">
  38. <td class="required w120">{$Think.lang.nav_new_open}</td>
  39. <td>
  40. <div class="onoff">
  41. <label for="sms_login_show1" class="cb-enable {if condition="$nav.nav_new_open eq 1"}selected{/if}">{$Think.lang.ds_yes}</label>
  42. <label for="sms_login_show0" class="cb-disable {if condition="$nav.nav_new_open eq 0"}selected{/if}">{$Think.lang.ds_no}</label>
  43. <input id="sms_login_show1" name="nav_new_open" value="1" type="radio" {if condition="$nav.nav_new_open eq 1"} checked="checked"{/if}>
  44. <input id="sms_login_show0" name="nav_new_open" value="0" type="radio" {if condition="$nav.nav_new_open eq 0"} checked="checked"{/if}>
  45. </div>
  46. </td>
  47. </tr>
  48. <tr class="noborder">
  49. <td class="required w120">{$Think.lang.nav_sort}</td>
  50. <td><input type="text" name="nav_sort" id="nav_sort" value="{$nav.nav_sort|default='0'}" class="w200"/></td>
  51. </tr>
  52. </tbody>
  53. <tfoot>
  54. <tr class="tfoot">
  55. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  56. </tr>
  57. </tfoot>
  58. </table>
  59. </form>
  60. </div>
  61. <script type="text/javascript">
  62. $(function(){
  63. $('#navigation_form').validate({
  64. errorPlacement: function(error, element) {
  65. error.appendTo(element.parent().parent().find('td:last'));
  66. },
  67. rules: {
  68. nav_title :{
  69. required: true
  70. },
  71. nav_url :{
  72. url : true
  73. },
  74. nav_sort :{
  75. number:true,
  76. range:[0,255]
  77. }
  78. },
  79. messages: {
  80. nav_title :{
  81. required: '{$Think.lang.ds_required_error}'
  82. },
  83. nav_url : {
  84. url :'{$Think.lang.ds_url_error}'
  85. },
  86. nav_sort:{
  87. number: '{$Think.lang.ds_digits_error}',
  88. range: '{$Think.lang.ds_range_0_255}'
  89. }
  90. }
  91. });
  92. });
  93. </script>