为什么将constrainInput设置为false而不允许我输入自定义字符?

时间:2015-07-08 00:00:59

标签: jquery jquery-ui

我正在使用jqueryUI datepicker窗口小部件,并且我将 constrainInput 设置为false,因此我可以键入" n / a"或者输入框中的一些其他自定义字符串,其类为 .some-date-field 。关于下面的设置有什么不对吗?每当我尝试输入自定义字符时

$('.some-date-field').each(function() {
     $(this).datepicker({
       dateFormat: "mm/dd/yyyy",
      changeMonth: true,
      changeYear: true,
       constrainInput: false
     });
   });

编辑:这是在页面中加载的其他javascript / jquery库(Rails 3.2应用程序的一部分)

some_javascript.js和disagreement.js 是自定义的javascript文件,但我不认为他们互相干扰。

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/base/jquery-ui.css" media="screen" rel="stylesheet" type="text/css" />
    <!-- JavaScript -->

    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>
    <script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js' type='text/javascript'></script>
    <script src="/assets/bootstrap.min.js?body=1" type="text/javascript"></script>
    <script src="/assets/chosen.jquery.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.anytime.compressed.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.bootstrap-editable.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.collapsible.min.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.cookie.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.fileupload.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.formSavior.min.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.iframe-transport.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.metadata.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.tablesorter.min.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery.tablesorter.widgets.min.js?body=1" type="text/javascript"></script>
    <script src="/assets/some_javascript.js?body=1" type="text/javascript"></script>
    <script src="/assets/disagreement.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
    <script src="/assets/jquery_nested_form.js?body=1" type="text/javascript"></script>

0 个答案:

没有答案