Jquery Error Message Saving in a file?

Question by : Jquery Error Message Saving in a file?

$ (docment).ready(function()
{
$ (“#form1″).validate(
{
rules:
{
FirstName:”required”,
LastName:”required”,

Email:{
required:true,
email:true
}.

Phonw:”required”,
}
});
});

Ok guys here is my jquery code …what i want to do is that i want to save the error msgs given by this jquery code into some file………any suggesstions???….
would be grateful….

Best answer:

Answer by Stephen
Your code will run on the client side. Browsers generally do not have access to the local computer’s file system (this is a security measure). You could put the entire function into a try-catch statement. Then, if there is an error, you could write the error to a cookie on the client computer. Also, many browsers (like Safari) have a built-in client-side database where you save information on the client machine. But if you want the information to be delivered to the server, your options are: 1. put the error message into a hidden form field. When the page re-posts to the server, read the content of that field, OR 2. send the error message back to the server using an asynchronous http xml request. All current browser support this. Your server would need to know how to read and handle asynchronous data. Asynchronous data is sent directly to the server without the need for a page repost. Again, this was just a general answer. Ask for more detail if you need it.

Give your answer to this question below!

Revisions

There are no revisions for this post.

Tags: , , , ,

No comments yet.

Leave a Reply