473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Date validations using AJAX

Hi,

I have a from with around 8 date fields.
All these are entered by the user and are to validated for holidays.
The holiday validation can only be done on server side.
I am planning to use AJAX for these date validations.
The validation must be done on onChange event of the date fields.

What is the best way to do this using AJAX?
Should i return XML data or JSON or just a simple text?

Thanks & Regards,
Sunil.

Jul 2 '06 #1
3 1666
"Sunil" <ch***********@gmail.comwrote in message
news:11**********************@a14g2000cwb.googlegr oups.com...
Hi,

I have a from with around 8 date fields.
All these are entered by the user and are to validated for holidays.
The holiday validation can only be done on server side.
Why?
I am planning to use AJAX for these date validations.
The validation must be done on onChange event of the date fields.

What is the best way to do this using AJAX?
Should i return XML data or JSON or just a simple text?
Isn't True/False sufficient?

Why not just validate client-side against a list of holiday dates?
Jul 2 '06 #2
On 02/07/2006 17:35, Sunil wrote:
I have a from with around 8 date fields.
All these are entered by the user and are to validated for holidays.
The holiday validation can only be done on server side.
Then submit the form to the server. AJAX isn't a substitute for these
sorts of things, and if this for the Web, then falling back to a simple
submission is the very least you need to implement, anyway.
I am planning to use AJAX for these date validations.
Why? How does that help the user (particularly users with scripting or
ActiveX disabled)?
The validation must be done on onChange event of the date fields.
Why? If later choices depend on the dates selected by the user, it's
entirely reasonable to break entry up over two pages.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jul 2 '06 #3
JRS: In article <11**********************@a14g2000cwb.googlegroups .com>
, dated Sun, 2 Jul 2006 09:35:24 remote, seen in
news:comp.lang.javascript, Sunil <ch***********@gmail.composted :
>All these are entered by the user and are to validated for holidays.
The holiday validation can only be done on server side.
I am planning to use AJAX for these date validations.

Of course, everything that really matters to the system owner must be
validated server-side.

However, if the application is such that most dates are in the near
future, it's feasible to send to the client a list of (or algorithm for)
near-future holidays, so that near-future holidays can be selected from
a list or validated client-side for faster response. Errors on non-
near-future dates will still be caught, on the server, where all dates
can be checked.

The server cannot check far-future holidays reliably, since national
holidays are subject to political whim.

On a company intranet, it could be quite interesting to discover that
the client-side validation has been by-passed; that means that someone
has been trying, probably in the company's time, to break the company's
system - which for most staff should be a disciplinary offence.

Alternatively, if someone breaks validation to enter a holiday date such
as (US) July 4th, let that be docked from his leave entitlement.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
7
by: Paul | last post by:
Hi, I have a form where a user is required to enter a start date and an end date. Both are required and must between a specific date range (e.g. 01/01/1900 and 01/01/2099) and the end date...
2
by: Rahul | last post by:
Hey Guys I have a development environment, in which the whole SQL syntax is stored in the Database. So the syntax in the databse column could be "where BirthDate = '12/31/2005' and ID =...
10
by: melissa.nava | last post by:
Here is my code: ***** Public Property DOB() As Date Get Try DOB = (msBirthMonth + "/" + msBirthDay + "/" + msBirthYear)
0
by: Garg | last post by:
Hi, I am using an AJAX calendar extender and binding it to a atextbox in my application. I want my calendar to enable only a few dates fro user to select. Say, dates from JAn 2006 to Jan 2007....
7
by: =?Utf-8?B?U3R1?= | last post by:
I have a ASP.NET Ajax app (using client library) calling ASP.NET Ajax-enabled web services. We are making use of the javascript proxies generated by ASP.NET Ajax. The problem we have is that the...
4
by: prakashsurya | last post by:
i need your help for writing javascript for date of birth.in dis we are using seperate drop down menus for date,month and year.....so wat are d validations to b considered 2 overcome dis.......
1
by: Diptirmaya | last post by:
i am new to js/ajax,, first of all plz say me the diff betn js,ajax. and give me some validation help about js with code example.. thanx
0
by: Suresh910 | last post by:
i have 5 date feilds in my form. i want to validate those fields and comparisions. i want code for those validations
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.