避免HTML文本框中的特定单词 [英] Avoid specific words in HTML Textbox

查看:59
本文介绍了避免HTML文本框中的特定单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在设计一个MVC4门户网站。对于特定的文本框,我不应该允许2个特定的单词,如Product,Registered,ProductRegistered......我如何实现这一目标?我想在客户端进行...(javascript或Jquery)?



任何示例代码都将受到赞赏...谢谢!!

Hi,
I'm designing an MVC4 web portal. In that for a particular textbox I'm not supposed to allow 2 specific words like "Product", "Registered", "ProductRegistered" ... How do i achieve this? I want to do it on client side... (javascript or Jquery)?

Any sample code will be appreciated... Thank you!!

推荐答案

请参阅以下链接,它可以帮助您。



文本框中的某些单词,禁用提交按钮 [ ^ ]



和如果你只有两个单词,那么只需在textbox_textchanged事件中检查该文本框的文本(在文本框中设置autopostback =true)



问候......:笑:
Refer to below link that can help you a bit.

certain words in a text box, disable the submit button[^]

And if you have only two word then just check for the text of that textbox in textbox_textchanged event(set autopostback="true" on textbox)

Regards... :laugh:


嗨vishnutejcj,



查看演示 - [演示]限制TextBox中的单词 [ ^ ]。



我有你sed mouseout 事件,您可以根据您的要求使用任何事件。
Hi vishnutejcj,

Check the Demo - [Demo] Restrict words in TextBox[^].

I have used mouseout event, you can use any event as per your requirement.


这篇关于避免HTML文本框中的特定单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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