chronister Posted March 20, 2007 Share Posted March 20, 2007 Hi All, I am completely ignorant of AJAX and Javascript in general. I can write PHP fairly decent, I just have not had the time to sit down and try to learn javascript. I would like to create a "post-it" note for my wife's intranet site. I have a text area that I have masked with some CSS so it don't look like a text area. I want to be able to simply type into the box and then through either an onChange or onBlur event trigger the AJAX request and write the updated notes to the database. I would like to make it happen without a submit button being pressed. I have checked out some ajax scripts and I just don't understand them enough to mess with them. Can someone point me in the right direction? The form I want to submit is below. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- #textarea { border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; background-color: #FFFFFF; } --> </style> </head> <body> <form id="post-it" name="post-it" method="post" action=""> <textarea name="notes" cols="50" rows="5" wrap="virtual" id="textarea" onChange="<!--call ajax-->" ></textarea> </form> </body> </html> The php I want run is basically this. <?php $notes=$_POST['notes']; connectdb(); $query="UPDATE notes SET notes='$notes' "; $result=mysql_query($query); if(mysql_affected_rows($result) > 0){ $message="Updated Notes Sucessfully"; } ?> I appreciate any input you folks can give me on this. Nate Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.