插入数据并进行验证 [英] insert data with validation

查看:63
本文介绍了插入数据并进行验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生

我遇到了问题。请帮助我。我的问题是


我必须插入电话号码。或同一领域的a / c id。我必须使用两个文本框。一个电话没有。另一个用于a / c id。如果我输入电话号码然后a / c id禁用。在/ c id文本框中没有输入接受。与电话号码相同,当我输入a / c id然后没有电话号码。允许进入。准时只允许一个条目。另一个是禁用。


请帮帮我。


谢谢

Sir
I face a problem.please help me. my problem is

i have to insert phone no. or a/c id in same field. i have to use two text box. one for phone no. another for a/c id. if i enter phone no. then a/c id disable. no input accept in a/c id textbox. same as phone no., when i entry a/c id then no phone no. entry allowed. On time only one entry allow. another is disable.

Please help me.

Thanks

推荐答案

使用JavaScript执行此操作。[html]< input type =" text"命名= QUOT;电话" ID = QUOT; pH值QUOT; onkeyup =" document.getElementById(''ac'')。disabled = !! this.value.length;">

< input type =" text"名称= QUOT;帐户] ID = QUOT; AC" onkeyup =" document.getElementById(''ph'')。disabled = !! this.value.length;"> [/ html]
Do that with JavaScript.[html]<input type="text" name="phone" id="ph" onkeyup="document.getElementById(''ac'').disabled = !!this.value.length;">
<input type="text" name="account" id="ac" onkeyup="document.getElementById(''ph'').disabled = !!this.value.length;">[/html]


这是一个JS问题,属于JavaScript论坛,所以我会把它移到那个。


Ronald
This is a JS question and belongs in the JavaScript forum, so I will move it to that.

Ronald


非常有趣..

但先生,为什么我们将其值设置为
very intrestng..
But sir why we are setting its value to
展开 | 选择 | Wrap | 行号


这篇关于插入数据并进行验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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