text_form.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="ncap-form-default">
  4. <form method="post" id="keyword_form">
  5. <dl>
  6. <dt><span class="error">*</span> {$Think.lang.keywords}</dt>
  7. <dd><input type="text" name="keyword" id="keyword" value="{$key.keyword|default=''}" placeholder="{$Think.lang.keywords}"style="width: 300px"/></dd>
  8. </dl>
  9. <dl>
  10. <dt><span class="error">*</span> {$Think.lang.k_value}</dt>
  11. <dd><textarea name="text" id="text" placeholder="{$Think.lang.k_value}">{$key.text|default=''}</textarea></dd>
  12. </dl>
  13. <dl>
  14. <dt></dt>
  15. <dd><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></dd>
  16. </dl>
  17. </form>
  18. </div>
  19. </div>
  20. <script>
  21. $(document).ready(function () {
  22. $('#keyword_form').validate({
  23. errorPlacement: function (error, element) {
  24. error.appendTo(element.parent().parent().find('dd:last'));
  25. },
  26. rules: {
  27. keyword: {
  28. required: true
  29. },
  30. text: {
  31. required: true,
  32. maxlength: 100
  33. }
  34. },
  35. messages: {
  36. keyword: {
  37. required: '{$Think.lang.keywords_required}'
  38. },
  39. text: {
  40. required: '{$Think.lang.k_value_required}',
  41. maxlength: '{$Think.lang.k_value_maxlength}'
  42. }
  43. }
  44. });
  45. });
  46. </script>