首页 \ 问答 \ jquery-如何在输入2位数字后自动插入冒号(jquery- How to automatically insert colon after entering 2 numeric digits)

jquery-如何在输入2位数字后自动插入冒号(jquery- How to automatically insert colon after entering 2 numeric digits)

我想要一个接受HH:MM(小时/分钟)格式的文本框。 所以,当用户输入HH的值时,它应该在那之后自动插入冒号并让用户输入MM的值。

我不想为此使用任何插件。

我该怎么做呢?

谢谢


I want a to have a text box which accepts HH:MM(hours/minutes) format. So, when the user enters the value for HH, it should automatically insert a colon after that and let the user enter value for MM.

I do not want to use any plugin for this.

How do i do this?

thanks


原文:https://stackoverflow.com/questions/30093786
更新时间:2024-01-16 19:01

最满意答案

答案是PARSENAME(full_object_name, part)函数 ,其中part可以是:1 =>对象名,2 => schema,3 =>数据库名,4 =>服务器名:

SELECT   @Proc_Name = PARSENAME(@Name, 1)       
        ,@Schema    = PARSENAME(@Name, 2)       
        ,@DB        = PARSENAME(@Name, 3);

The answer is PARSENAME(full_object_name, part) function where part can be: 1 => object name, 2 => schema, 3 => database name, 4 => server name:

SELECT   @Proc_Name = PARSENAME(@Name, 1)       
        ,@Schema    = PARSENAME(@Name, 2)       
        ,@DB        = PARSENAME(@Name, 3);

相关问答

更多
  • 您可以在结果列表中使用strsplit()和lapply() : > unlist(lapply(strsplit(names, " "), function(x) { return(x[length(x)-1]) })) [1] "Kerry" "Chafee" "Dodd" "Lieberman" "Lautenberg" [6] "Moynihan" "D'Amato" "Specter" "Rockefeller" "Levin" ...
  • 我们可以调用sub()来匹配整个字符串,从(1)任意数量的任何字符开始,然后(2)一个文字点,然后(3)使用捕获组捕获下面的字符,然后(4)a文字_tot 。 然后我们可以使用\1反向引用原子(根据R的字符串编码规则正确地反斜杠转义反斜杠)用捕获的字符替换整个字符串。 DF$c <- sub('^.*\\.(.)_tot$','\\1',DF$a); DF; ## a b c ## 1 a.b.c_tot 1 c ## 2 b.c.d_tot 2 d ## 3 d.e.g_tot 3 g ...
  • 由于你有一个分隔的字符串,我个人使用Split函数。 另请注意,您的If UCase(Cells(Q, "B").Value) Like "*Other Team*" Then测试会在您的示例数据中的每个输入上失败 - 只有您跳过的列标题才会出现, 假设您将测试更改为大写,就像您输入一样。 如果您正在尝试确定自己是否在正确的工作表上,则需要超出循环范围。 像这样的东西: If UCase$(Cells(1, "B").Value) Like "*OTHER TEAM*" Then Dim token ...
  • 认为你想要这样的东西, : ([A-Z][a-z]*(?: [A-Z][a-z]*)*(?:, [A-Z][a-z]*(?: [A-Z][a-z]*)*)*)(?: and(?: \w+)? ([A-Z][a-z]*(?: [A-Z][a-z]*)*))? DEMO Think you want something like this, : ([A-Z][a-z]*(?: [A-Z][a-z]*)*(?:, [A-Z][a-z]*(?: [A-Z][a-z]*)*)*)(?: and(?: \w+)? ( ...
  • 你可以使用awk, $ awk -F\| '{print $5}' file SAMD11 SAMD11 SAMD11 SAMD11 NOC2L NOC2L NOC2L KLHL17 NOC2L 如果要删除重复项,则将awk输出传递给sort -u , $ awk -F\| '{print $5}' file | sort -u KLHL17 NOC2L SAMD11 正如@jaypal所建议的那样,您可以使用下面的awk one-liner命令删除重复项。 awk -F\| '!seen[$5]++ ...
  • 答案是PARSENAME(full_object_name, part)函数 ,其中part可以是:1 =>对象名,2 => schema,3 =>数据库名,4 =>服务器名: SELECT @Proc_Name = PARSENAME(@Name, 1) ,@Schema = PARSENAME(@Name, 2) ,@DB = PARSENAME(@Name, 3); The answer is PARSENAME(f ...
  • 假设您可以构建一个国家/地区列表,您可以将其组合成一系列更改,如下所示: (Canada|Malaysia|France|South Africa) 必须优化长列表,但这是另一个故事(见下文)。 然后你可以使用这样的正则表达式: ^(?=.*(\b\d{4}\b))(?=.*\b(Canada|Malaysia|France|South Africa)\b) 要将年份和国家/地区捕获到第1组和第2组。在正则表达式演示中 ,请参阅右侧窗格中的捕获。 捕获: 1990 Canada 2000 M ...
  • 你可以使用这个表达式: ^CN=(.*?)\\, (.*?), 现场演示 。 它使用两个捕获组作为姓名和其他周围的静态文本。 You can use this expression: ^CN=(.*?)\\, (.*?), Live demo. It uses two capturing groups for first and last names with the other static text around them.
  • SELECT name FROM yourtable WHERE storename LIKE '%yourchoice%' SELECT name FROM yourtable WHERE storename LIKE '%yourchoice%'
  • 通过ClassName ,是指您引用模型的名称,例如User in new User(); ? 如果是这样,遗憾的是这是不可能的,因为您给模型类的名称只是一个变量名而不是模型声明的一部分。 考虑: var Foo = Backbone.Model.extend({}); var Bar = Foo; ClassName Foo还是Bar ? 相反,只需为每个模型指定一个name属性: var Foo = Backbone.Model.extend({ name:"Foo" }); 这样,您可以通过m ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)