如何将表单验证错误消息传递到工具提示文本中 [英] How to pass the form validation error msg into the tooltip text

查看:63
本文介绍了如何将表单验证错误消息传递到工具提示文本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我怀疑是否可以将表单验证错误消息提供给用于字段描述的工具提示。


在此先感谢,


欢呼,

解决方案

请出示您的代码。 ..什么领域,你的工具提示是什么意思?


亲切的问候


[HTML]< form name =" test" method =" post">

< tr>

< td>用户名:< / td>< td>< input type =" text"名称= QUOT; FNAME" ID = QUOT; FNAME"大小= QUOT; 30英寸; tooltipText ="在此框中输入您的名字" />< / td>

< / tr>

< tr>

< td>密码:< / td>< td>< input type =" password"名称= QUOT; PWD"值= QUOT;"大小= QUOT; 30英寸; ID = QUOT; PWD" tooltipText ="在此框中输入您的密码">< / td>

< / tr>

< tr>

< td>& nbsp;< / td>< td>< input type =" submit"命名= [提交"值= [新增" class =" btn">< / td>

< / tr>

< / form>

[/ HTML ]

以上将是我的代码,其中有两个字段,工具提示显示有关这些字段的描述,如果我想验证用户名,我想显示那些验证文本到同样的工具提示,这可能吗?


regds

你的验证函数中的

引用节点并使用 setAttribute()方法:

展开 | 选择 | Wrap | 行号

Hi,
I have a doubt whether it is possible to give the form validation error msg to the tooltip which is used for field description.

thanks in advance,

cheers,
vengo.

解决方案

please show your code ... what field, what tooltip do you mean?

kind regards


[HTML]<form name="test" method="post">
<tr>
<td>User Name:</td><td><input type="text" name="fname" id="fname" size="30" tooltipText="Type in your First Name in this box" /></td>
</tr>
<tr>
<td>Password:</td><td><input type="password" name="pwd" value="" size="30" id="pwd" tooltipText="Type in your Password in this box"></td>
</tr>
<tr>
<td>&nbsp;</td><td><input type="submit" name="Submit" value="Add" class="btn"></td>
</tr>
</form>
[/HTML]
The above will be my code in which there are two fields with the tool tip displaying about the description about those fields and if i want to validate the user name i want to display those validation text in to the same tooltip, is this possible?

regds


in your validation function refer to the node and use the setAttribute() method:

Expand|Select|Wrap|Line Numbers


这篇关于如何将表单验证错误消息传递到工具提示文本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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