View Full Version : How to retrieve the data from web page

03-22-2009, 12:32 AM

I am having question on how to retrieve data from web page.

There are 'Yes' , 'No' checkbox for different questions on the web page. There are around 50 such questions.

I have to retreive the values submitted by the user by clicking on either Yes or No checkboxes. Then save this data on the server. I have to use Javascript for this.

Since I am new to Javascript I am not getting idea how to implement it.

Any help is very much appreciated. Please let me know at the earliest.


Philip M
03-22-2009, 01:30 PM
There are 'Yes' , 'No' checkbox for different questions on the web page. There are around 50 such questions.

I am afraid that I don't really understand. If there are checkboxes for both Yes and No, what is to stop the user checking both boxes? Surely what you want is radio buttons?

What if the user checks neither box, or selects neither radio button?

Be aware that JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), access a database or the client's operating system, or alter the default behaviour of the browser. In other words, you will need either a server-side language or Ajax to save the data.

Old Pedant
03-22-2009, 11:50 PM
Actually, Philip, I think your "unless used with an Ajax call..." is a tad misleading.

It is *STILL* true that JavaScript alone can't do anything on the server. That AJAX call *MUST* call some server-side technology and both the effect and the requirement is no different than if you submit the <FORM> to a server-side processor.

Unless the JS author has access to some server-side process that is designed to handle the form contents, AJAX won't help a bit. And, of course, it's actually much more complex to make an AJAX call and pass all the <FORM> contents than it is to simply submit to a PHP/JSP/ASP/ASP.NET page.

I guess I'm saying don't encourage non-server-side coders into thinking AJAX is some magic bullet. It's usually just a way to make life even more complex for the coder.