开发者

Validate selected form data on link click

I have a form that is broken into several screens. Although it is a single form, because of its size I am using jQuery to visuall开发者_如何学编程y break it into several smaller sections.

There is a simple link to navigate to the "next section" which triggers a div show/hide.

I would like to validate each section as the user proceeds, rather than on submit at the end.

I'm using the jQuery plugin located here:

http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

While it's clear how to validate the form as a whole, I am finding it hard to understand how I might attach a validate function to a handful of selected inputs on a link click. If it validates, then the show/hide function would proceed them to the next part.


How about an Ajax post back on certain fields?

We looked into this as well and eventually gave up as it added a lot of time to the site execution and made the user experiance bad.

We eventually just settled for an ajax check when the user clicked the next button at which point we validated ages, emails, phone numbers etc.

All the required information was checked by required field validators as the user tabbed through the form.

edit

I just wanted to re state that we tried on the fly servaer side validation but rejected it because of web page speed. for example, as the address was being validated the user was tying elsewhere and the sudden appearance of an error message some seconds later confused and infuriated them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜