any recommendation on concepts or better if there's codes which I can modify. Best if the codes comes with explaination of processes etc
Main Topics
Browse All TopicsI'm currently working on my mini blogging site (from scratch) and wish to implement an auto save feature, which will update my server with a draft when the user is typing in to the mail box (like google). How can it be implemented with asp?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
One option would be to have the "edit content" inside an iframe, the iframe can contain a form with a multi line text box, and a javascript timer running in the background that periodically "posts" the data back to itself... and as part of the posting process it could capture the content, save it and then put it back into the text box... Main issue I can think of tho would be cursor positioning as it is likely to happen during someone typeing...
Also you might want to consider using a rich text editor for you blog, and they may have this feature built in.
ok, you have an HTML form right, let's say it's called 'myform' and let's say you want to update to the server every time a field loses focus (ie the user tabs to the next field) then in the onblur event handler you would just call this:
$('myform').request();
That's it, your form data has been posted to the server and the user has no idea. Your server can handle it however you want, that's up to you and your ASP code.
For example, here's a real stupid test page, but it should show you how to include it in your own page. Note, I add the event handlers to the form dynamically with the setElements function, you can use that or you can hard code the events whereever you want.
Don't forget, download prototype.js and include it like I have in the example below (like this: <script type="text/javascript" src="prototype.js"></scrip
Also, check this page out, it'll knock your socks off: http://www.prototypejs.org
<html>
<head>
<script type="text/javascript" src="prototype.js"></scrip
<script type="text/javascript">
function updateIt(formId)
{
$(formId).request();
}
function setElements(formId)
{
var elephants = document.forms[formId].ele
for(var i=0; i<elephants.length; i++)
{
elephants[i].onblur= new Function("updateIt('myform
}
}
</script>
</head>
<body onload="setElements('myfor
<form name="myform" id="myform" method="post" action="http://www.mysite.
<input type="text" name="txt1" id="txt1"/>
<input type="text" name="txt2" id="txt2"/>
<input type="text" name="txt3" id="txt3"/>
<input type="submit"/>
</form>
</body>
</html>
well don;'t you already have a server side asp script for processing the form?
it would be handled by the same script - you are just posting the form to the same place... i assume you have the asp under control... non? if not then you can base your asp code of the tutorials here:
http://www.w3schools.com/a
you will need a way to differentiate between a full form submit and a partial (save as draft) submit....
there are many ways you could do this, i'd start by experimenting with putting a name and value on the submit button (like this):
<input type="submit" name="saveas" value="Save"/>
not sure if prototype will send that value when you call $(formId).request(); if not then this will work and you can test to see if saveas = 'Save'
if that doesn't work, then you could try something more tricky, like adding a hidden field that is updated when form is submitted:
<form name="myform" id="myform" method="post" action="http://www.mysite.
<input type="text" name="txt1" id="txt1"/>
<input type="text" name="txt2" id="txt2"/>
<input type="text" name="txt3" id="txt3"/>
<input type="hidden" name="saveas" id="saveas" value="draft"/>
<input type="submit"/>
</form>
then you can test to see if saveas is 'draft' or 'final'
oops, that was bad syntax, should have been this:
<form name="myform" id="myform" method="post" action="http://www.mysite.
Business Accounts
Answer for Membership
by: basicinstinctPosted on 2007-09-11 at 02:35:02ID: 19867069
you would need to use ajax, i recommend using prototype: http://www.prototypejs.org /
this way you can pick whatever javascript events you want to trigger updates to the server "behind the scenes" that the user would not be aware of...