English 中文(简体)
j Query Form Validation (http://validator.codeplex.com/) 不满足具体需要
原标题:jQuery Form Validation (http://validator.codeplex.com/) Not Working for specific need

I am trying to use this script to validate a form: http://validator.codeplex.com/

我正试图建立一个具有缺省价值的投入领域:“第一和最后名称”

<div class="RightForm"><input type="text" id="firstlastname" name="firstlastname"
value="First and Last Name" style="width: 175px; float:right;" validate="form" invalid=
"<b>First and Last Name missing</b><br/>Please enter your First and Last name." 
invalidVal="First and Last Name" /></div>

如果被点击的人在不改变这一缺省价值的情况下提交,我就希望验证能够用“第一和最后名称”的电文显示文字上的缺省。 因此,对这两个案件都应发出警告。

然而,现在该文字只是显示“未界定”而不是错误信息。

对我如何解决问题有什么想法? 感谢你!

最佳回答

眼前需要的是这一法典范畴:

invalid="<b>First and Last Name missing</b><br/>Please enter your First and Last name."

如果您以超文本的属性使用超文本代号,则must。 由于实体或您将打破超文本, j印可能无法理解:

invalid="&lt;b&gt;First and Last Name missing&lt;/b&gt;&lt;br/&gt;Please enter your First and Last name."

不用说,<代码>invalid不是法定的超文本属性,这似乎被完全用作 j。

此外,你不应把<条码>价值归责,而应使用<条码> 持有人/代码>。 相反:

placeholder="First and Last Name"

这也许会考虑到你重新提出的问题,因为实地实际上不会有“价值”,但如果空闲,案文将出现在投入中。

另一边:如果你与你重新使用的图书馆站在一起,事实上的图书馆就是:

问题回答

暂无回答




相关问题
Bind Button.IsEnabled to custom validation with XAML?

I am sorry I didn t know how to title my question any better, you name it if you got a good 1. I have an entity Contact. this person has navigation properties: Address, Phones (A collection of Phone)....

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

Wpf Combobox Limit to List

We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first ...

Rails 101 | validates_currency?

I ve searched high and low, but I could not find a solution, to what I think seems like a very common task. In a form I want to have a text input that accepts currency strings (i.e. $1,000,000 or ...

CodeIgniter form verification and class

I m using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?...

热门标签