Click here to Skip to main content
15,074,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, hopefully someone can point a total non web programmer in the right direction - I know a little so be gentle :)

I have a web form that has dynamic content on there, each field has a specific value associated, i.e. Q12345 related to a field in a table, under ID 12345 - so i can trace what is being posted as I wont actually know. So - we have these forms - sometimes they have 300 items on there. The pages are session less so there should not be any timeouts but the problem is, some client's, users are saying that they have saved the form and then refuse to fill it out again - who could blame them ! so what I need to do, is use ajax i believe, to post each of these questions on the form, as they fill it out. I would just want to post a few pieces of information:

A code we call ACode which is hidden field that holds the value of the "form as a whole"
A client identifier field called CID
and a Question field, which has either a graphic or text box or both
I am happy to do a separate post on the graphic and the text box just so we have a bullet proof save

At the moment, it is one form and everything gets posted in one go. this can take up to 10 seconds to digest at the server end.

So what Im looking for, is an onclick that runs an ajax post (I think, correct me if I am wrong) that will post just the bit that I want to send to the server

if that is possible, is it also possible, if for example the user was on wifi and the signal went down, can i send back a piece of information to the browser, from the server to say "save answer ok" and if that did not return to the browser, on the next post, it would try and send what originally didnt go PLUS what has just been answered.
effectively, if the wifi was down for a while then some sort of alert to let the user know, the form cannot be saved until there is a response from the server, to which whatever was not sent, can be sent in one go.

Im not expecting anyone to write it for me - I wont learn anything that way, but if some code was to be shown i.e. the ajax, an example object and method of maybe doing the error capturing on the save to build it up for the next save try then that would be really appreciated.

Sorry I cant even show any code - I have nothing to show other than its just a huge form asking questions and I want to send each reply as they happen rather than a whole form on a submit.

Thanks!

What I have tried:

googling, codeproject, Ive seen some php similar answers, but nothing for asp classic
Posted
Updated 19-Feb-20 9:27am
v2

1 solution

Take Classic ASP out of the mix for the time being, as what you are looking for at first will be what is on the HTML page the end user sees, and I think you are on the correct track with utilizing AJAX to accomplish this.

I have seen similar done using the onblur event attached to the input elements. Basically anytime a field loses focus it will fire a JS routine grabbing the field's name/value as well as the FormID (your ACode) and then submitting that information via an AJAX call.
All of this should be relatively easy to find samples for.

Now the Classic ASP is the other half of your equation. There is a lot of documentation out there for this as well, but it can be difficult to find as "Classic ASP" wasn't the name for this until a few years after ASP.NET was released.

As I did plenty of the Classic work in my youth.... I do remember what site that I frequented (besides here) and learned quite a bit about VBA/Classic ASP and how this all worked. They still have a good long list of articles from the late 90s which should give you plenty of information to start with.

Active Server Pages Index - 4GuysFromRolla.com[^]

Now once you get to a specific problem that you are having implementing this, feel free to come back and ask for help. While someone may not write out the solution for you, there are plenty of people here who can help you with the bad line of code here or there types of issues
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900