文本已更改文本框的事件 [英] Text changed event for textbox

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

问题描述

嗨...

我很想MVC.In查看有两个文本框。当我将更改第一个文本框值时,第二个文本框值也会根据第一个文本框值而改变。那么如何在mvc中为文本框编写文本更改事件。

谢谢...

解决方案

这是一个javascript问题。您可以使用jquery为文本更改设置事件,并同时更改其他控件中的文本。 MVC与它毫无关系,它是创建HTML和javascript的引擎,在这种情况下,你想直接编写javascript。



另一个人给出了错误的答案。这就是你要做的:



('#eventType')。change(function(){

( '#文本2')。文本(

Hi...
I am begginer to MVC.In View there are two textboxs.When i will change first textbox value at that time second textbox value also alter depending on first textbox value..So How to write text change event for textbox in mvc.
Thanks...

解决方案

This is a javascript question. You can use jquery to set up events for text change, and to change the text in your other control at the same time. MVC has literally nothing to do with it, it's an engine for creating HTML and javascript, and in this case, you want to write the javascript directly.

The other person has given a wrong answer. This is what you'd do:


('#eventType').change(function() {


('#text2').text(


这篇关于文本已更改文本框的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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