thiscolddecembe
08-12-2007, 04:49 AM
Ajax is out there to k((i((l((l)) me. D:
edit.php
...
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.write("<center>"+ajaxRequest.responseText"</center><br>")
}
}
var name = document.getElementById('name').value;
var description = document.getElementById('description').value;
var query = "&name="+name"&description="+description"";
xmlHttp.Request.open("GET","edit_ss.php"+query,true);
xmlHttp.Request.send(null);
}
</script>
<?php
echo "<b>Note:</b> 'Last Name' needs to be ONE letter - Please start filling these in!</b>";
echo "<form id='thing'>";
echo "Name <input type='text' id='name'><br><br>Description<br><textarea cols=80 rows=10 value='".$row['description']."' id='description'></textarea><br><br><input type=submit value=Update! onClick='javascript: ajaxFunction()'></form>";
...
What's wrong with this?! I know I'm not a javascript guru..>_> But yeah. The code on "edit_ss.php" is correct; It GET's the vars and updates the DB with them.
Although this form just clicks and reloads the page.. and then doesn't update. x.x
[PS: The thumgs down is for how bad ajax can be to poor newbs. =p]
-TCD
edit.php
...
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.write("<center>"+ajaxRequest.responseText"</center><br>")
}
}
var name = document.getElementById('name').value;
var description = document.getElementById('description').value;
var query = "&name="+name"&description="+description"";
xmlHttp.Request.open("GET","edit_ss.php"+query,true);
xmlHttp.Request.send(null);
}
</script>
<?php
echo "<b>Note:</b> 'Last Name' needs to be ONE letter - Please start filling these in!</b>";
echo "<form id='thing'>";
echo "Name <input type='text' id='name'><br><br>Description<br><textarea cols=80 rows=10 value='".$row['description']."' id='description'></textarea><br><br><input type=submit value=Update! onClick='javascript: ajaxFunction()'></form>";
...
What's wrong with this?! I know I'm not a javascript guru..>_> But yeah. The code on "edit_ss.php" is correct; It GET's the vars and updates the DB with them.
Although this form just clicks and reloads the page.. and then doesn't update. x.x
[PS: The thumgs down is for how bad ajax can be to poor newbs. =p]
-TCD