• 首页
  • PB入门
  • pbootcms安装/升级
    • PBootCMS安装
  • pboot标签调用
    • pb通用留言标签
    • 搜索框标签
    • 公司信息标签
    • 导航菜单列表标签
    • 当前栏目标签
    • pbootcms指定栏目标签
    • pbootcms内容列表标签
    • 内容详情页标签
    • 指定内容标签
    • 指定内容多图遍历
    • 内容tags标签调用
    • 指定内容多选字段遍历
    • pbootcms分页条标签
    • pb幻灯片轮播图标签
    • 友情链接标签
    • 留言自定义表单标签
    • 文章评论
    • 多条件搜索
    • 多语言/区域建站
    • PbootCMS常用 if 判断
pb通用留言标签

pb通用留言标签

1.留言提交表单

单留言

<form onsubmit="return submsg(this);" method="post">

如果一个页面多个表单就用这个

<form action="{pboot:msgaction}"  method="post">

或

<form action="{pboot:form fcode=*}"  method="post">

fcode=这个后面是表单的ID

image.png

2、留言记录列表可用标签


[message:n]序号从0开始
[message:i]序号从1开始
[message:contacts]联系人
[message:mobile]手机
[message:content]内容
[message:recontent]回复内容
[message:ip]用户IP
[message:os]用户操作系统
[message:bs]用户浏览器
[message:askdate]留言时间
[message:replydate]回复时间
[message:***]自定义的其它字段
[message:nickname]会员昵称(V3.0+)
[message:username]会员账号(V3.0+)
[message:headpic]会员头像(V3.0+)


3、单多选


<script>        

  var mySwiper = new Swiper ('.swiper-container', {

    direction: 'horizontal',

    loop: true,

    speed: 1500,

    autoplay : {

        delay:3500,

        disableOnInteraction: false

     },

     

    

    // 如果需要分页器

    pagination: {

      el: '.swiper-pagination',

      clickable :true,

    },

    

    // 如果需要前进后退按钮

    navigation: {

      nextEl: '.swiper-button-next',

      prevEl: '.swiper-button-prev',

    },

   

  })        



//ajax提交表单

function subform(obj){

  var url='/form/2/';

  var name=$(obj).find("#name").val();

  var tel=$(obj).find("#tel").val();

  var info=$(obj).find("input[name='xueli']:checked").val()+","+$(obj).find("input[name='gongzuo']:checked").val()+","+$(obj).find("input[name='xyjibie']:checked").val();


  var reg = /^(1|0)[\d\-]+$/;   

  if (!reg.test(tel)) {

    alert('电话号码错误!');

    return false;

  }


  $.ajax({

    type: 'POST',

    url: url,

    dataType: 'json',

    data: {

      name: name,

      tel: tel,

      info: info

    },

    success: function (response, status) {

      if(response.code){

     alert("查询成功,结果将通过短信发送给您!");

     $(obj)[0].reset(); 

      }else{

       alert(response.data);

      }

    },

    error:function(xhr,status,error){

      alert('返回数据异常!');

    }

  });

  return false;

}

</script>

  var info=$(obj).find("option[name='xueli']:checked").val();

这个是多选的