如何根据另一个文本框获取文本 [英] How to get text of one text box according to another

查看:97
本文介绍了如何根据另一个文本框获取文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是mvc的新手。

我有两个文本框如下 -

电子邮件:

Hi,
I m new to mvc.
I have two textboxes like follows-
Email:

<input type="text" id="txt_email" />



用户名:


Username:

<input type="text" id="txt_username" />





我想要在txt_email中编写电子邮件时,用户名应根据sql数据库显示在txt_username中。



I want while writing email in txt_email,user name should display in txt_username according to sql database.

推荐答案

使用jQuery自动完成功能。 onChange文本框你可以使用它,并调用一个jQuery post事件并将你的文本框值作为参数传递,并获得结果,如下面的例子中可用的标签,他们是硬编码值

这是链接
Use jQuery auto complete functionality. onChange of text box you can use this, and do call a jQuery post event and pass your textbox value as parameter and get the result as in below example in available tags they are hard coding the values
Here is the link


只是去谷歌搜索一下,

你会得到很多教程和例子......
just go to google and search about it ,
you will get many tutorials and examples...


这篇关于如何根据另一个文本框获取文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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