javascript函数仅在单击按钮时显示标签值? [英] javascript function to display a lable value only if the button is clicked ?

查看:84
本文介绍了javascript函数仅在单击按钮时显示标签值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个javascript函数,仅在单击按钮时才在表单上显示标签值...例如,仅在提交值时才显示对电子邮件的验证,它应该在标签中显示错误,否则相应地标签应该不可见.

i need a javascript function to display a label value on a form only wen the button is clicked...for example to show validation for an email only when the value is submitted it should show an error in the label that accordingly otherwise the label should not be visible.

推荐答案

嗨 您可以使用Jquery来验证控件.

Hi You can use Jquery to validate your control.

<script src="jquery.js"></script>
<script src="jquery.validate.js"></script>
<input id="cname" name="name" size="25" class="required" minlength="2" />



只要您单击提交"按钮,而无需在文本框中输入任何值,上述文本框就会自动验证.

注意:-您可以从此处下载脚本文件
插件/验证 [



The above textbox will automatically validate whenever you click on submit button without entering any value in textbox.

Note:- You can download script files from here
Plugins/Validation[^]

Thanks,
Imdadhusen


这篇关于javascript函数仅在单击按钮时显示标签值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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