Hmm just worked something out
Code:
<html>
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
jQuery(function($){
var field1 = $('#fldrChatWindow');
$('#send').click(function(){
if(!field1.html()){
alert("Please enter a value");
field1.focus();
return;
}
jQuery.ajax({
url: 'process.php',
type: 'post',
data: 'field1value=' + field1.html(),
success: function(results){
alert(results);
}
});
});
});
</script>
</head>
<body>
<body>
<div style="float:left; width:33.3%; height:60%; background-color:white; border: 3px darkgrey solid; overflow:auto;" id="fldrChatWindow" contenteditable></div>
<input type="button" value="Submit" id="send">
</body>
</body>
</html>
Works fine but
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
jQuery(function($){
var field1 = $('#fldrChatWindow');
$('#send').click(function(){
if(!field1.html()){
alert("Please enter a value");
field1.focus();
return;
}
jQuery.ajax({
url: 'process.php',
type: 'post',
data: 'field1value=' + field1.html(),
success: function(results){
alert(results);
}
});
});
});
</script>
</head>
<body>
<body>
<div style="float:left; width:33.3%; height:60%; background-color:white; border: 3px darkgrey solid; overflow:auto;" id="fldrChatWindow" contenteditable></div>
<input type="button" value="Submit" id="send">
</body>
</body>
</html>
Dosen't
Anyone know why the doctype is messing it up???
Bookmarks