用于更改IP地址的输入框 [英] Input box for changing IP Address

查看:113
本文介绍了用于更改IP地址的输入框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为IP地址,广播和子网创建输入字段。输入用于更改服务器的IP。它是一个内部网站。



我想让用户得到一个输入框,其中的句点被硬编码到文本框中。这样当他们开始打字时,他们只需要输入数字并能够选中下一部分的IP。或者如果用户输入3个字符,它会自动将他发送到ip的下一部分。



我不知道这是否只能用HTML和CSS,或者这是更多的JavaScript应用程序。



http://jsfiddle.net/3F2gM/1/

谢谢。

解决方案

您可以使用掩码插件 - < a href =http://jsfiddle.net/3F2gM/3/ =nofollow> DEMO



<$ p $ {$ b $(input)。mask(9?99.9?99.9?99.9?99,{placeholder:});
});


I am trying to create an input field for an IP address, broadcast, and subnet. The inputs are used to change the ip of the server. Its an internal website.

I want to make it so that the user gets an input box that has the periods hardcoded into the text box. This way when they start typing, they only have to input the numbers and be able to tab to the next part of the ip. Or if the user enters 3 characters, it automatically sends him to the next part of the ip.

I don't know if this is something that can only be done with html and css or if this is more of a javascript application.

http://jsfiddle.net/3F2gM/1/

Thanks.

解决方案

You can use a mask plugin - DEMO

jQuery(function($){
   $("input").mask("9?99.9?99.9?99.9?99", {placeholder:" "});
});

这篇关于用于更改IP地址的输入框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆