Git Product home page Git Product logo

Comments (4)

kikyzhanglihui avatar kikyzhanglihui commented on September 26, 2024

1、在init方法中,追加closeFn参数;
init: function(params) { ..... this.closeFn = params.closeFn; }
2、在取消函数中执行closeFn,并将表单元素作为参数传递给该方法;
//取消 function closeMobileCalendar(e) { ...... typeof _self.closeFn === 'function' && _self.closeFn( _self.trigger); }

3、在实例化调用时定义closeFn,操作表单元素获取值
var calendar = new LCalendar(); calendar.init({ 'trigger': '.datepicker', 'type': 'ym', 'minDate': '1900-1', 'maxDate': new Date().getFullYear() + '-' + (new Date().getMonth() + 1) , 'closeFn': function(oInput){ alert(oInput.value) } });

from lcalendar.

 avatar commented on September 26, 2024

https://github.com/yudaren007007/qz-calendar 修改了一下,简单粗暴直接获取input.value就能取到值

from lcalendar.

yancongwen avatar yancongwen commented on September 26, 2024

你们都搞那么复杂干嘛?直接监听input事件就好了嘛

document.getElementById('你的id').addEventListener('input', e => {
  console.log(e.target.value)
})

from lcalendar.

xfhxbb avatar xfhxbb commented on September 26, 2024

document.querySelector('#demo1').value

from lcalendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.