Okay...I have reverted the index.tpl back to the working copy that was said to be correct. This was done on post 2. Changes were...
Id was given to the form: id="newmessage
Submit was replaced by button in the input type.
Then in post 14, a new send_message.js was given that was said to be working. I used that as the current send_message.js.
In Internet Explorer it just goes to a second line when entered. Clicking send does nothing.
Firefox and Chrome do the same thing...nothing....
Here is the converted code, given from post 2 and post 14. What am I doing wrong? I made all the changes that were given, but nothing is working in any browers... I'm not trying to be difficult. It's being difficult with me LOL! Very frustrating. I've been at this for over a week just trying to figure out how to get it to enter.
INDEX.TPL - ALL CODE
Code:
<?php
/**
* SocialEngine
*
* @category Application_Widget
* @package Widget
* @copyright Copyright 2012
* @license free
* @author XCalibre
*/
?>
<SCRIPT LANGUAGE="JavaScript">
function open_pop(){
window.open('application/widgets/shoutbox/emot_box.html','mywin','left=20,top=20,width=470,height=230,toolbar=1,resizable=0');
}
</SCRIPT>
<html>
<head>
<script src="application/widgets/shoutbox/js/jQuery.js" type="text/javascript"></script>
<style type="text/css">
/* Main Shoutbox */
.chatBox {
padding: 5px;
height: 268px;overflow: auto;
width: "100%";
font-family: Arial,Helvetica,sans-serif;
font-size: 11px;
background-color: #CFCFCF;
-moz-border-radius-topleft: 6px;
-moz-border-radius-topright: 6px;
-moz-border-radius-bottomright: 0px;
-moz-border-radius-bottomleft: 0px;
-webkit-border-radius: 1px 1px 0px 0px;
border-radius: 1px 1px 0px 0px;
border-style:solid;
border-width:1px;
border-color:#3C0000;
}
.chatBox .user {
background-color: #DFDFDF;
text: bold;
}
#username {
background-color:#DFDFDF;
text: bold;
}
/* Logging Messages */
.chatBox .main {
background-color: #fff;
height: 175px;
padding: 5px;
overflow: auto;
}
/* New Messages */
#newMessageContent {
font: 14px ariel, sans-serif;
width: 400px;
border-radius: 1px 1px 0px 0px;
border-style:solid;
border-width:1px;
border-color:#000000;
margin 5px;
}
/* Smilies*/
.chatBox .messageBox .smiley {
float: left;
}
#insertSmilies {
height: 38px;
width: 100px;
border-radius: 1px 1px 0px 0px;
border-style:solid;
border-width:1px;
border-color:#000000;
margin 5px;
}
/* End Smilies */
/* SIZE OF SEND BUTTON */
#newMessageSend {
height: 38px;
width: 100px;
border-radius: 1px 1px 0px 0px;
border-style:solid;
border-width:1px;
border-color:#000000;
margin 5px;
}
.chatBox .messageBox .left {
float: left;
}
</style>
</head>
<body>
<div class="chatBox">
<div class="user">
Welcome <input type="text" size="13px" name="username" id="username" value="<?php echo $this->translate('%1$s', $this->viewer()->getTitle()); ?>" readonly="readonly" style="border:hidden"/>
</div>
<div class="main">
</div>
<div class="information">
Enter Text Below:
</div>
<div class="messageBox">
<form name ="newMessage" id="newmessage" class="newMessage" action="" onclick="">
<div class="left">
<textarea name="newMessageContent" id="newMessageContent"></textarea>
</div>
<div class="smiley">
<input type="button" value = "Smilies" id="insertSmilies" onClick="open_pop()" />
</div
<div class="right">
<input type="submit" id="newMessageSend" value="Send" />
</div>
</form>
</div>
<script src="application/widgets/shoutbox/js/refresh_message_log.js" type="text/javascript"></script>
<script src="application/widgets/shoutbox/js/send_message.js" type="text/javascript"></script>
<script src="application/widgets/shoutbox/js/protect.js" type="text/javascript"></script>
</script>
</body>
</html>
SEND_MESSAGE.JS - ALL CODE
Code:
$(function() {
$('form.newMessage').submit(function(e) {
e.preventDefault();
var username = $("#username").val();
var message = $("#newMessageContent").val();
if (message.length > 0 || message == "Enter your message here") {
return false;
}
var dataString = $("#username,#newMessageContent").serialize();
$.ajax({
type: "POST",
url: "/application/widgets/shoutbox/send_message.php",
data: dataString,
success: function() {
message="";
}
});
});
//this function below watches for "enter" in the keyup action, jsut inside of the newmessage textarea
$("#newMessageContent").keyup(function(e){
var key;
if(window.event){
key = window.event.keyCode;
}
else{
key = e.which; //firefox
}
if (key === 13 ) {
if (e.shiftKey === false){
$("#newMessageSend").click();
}
}
});
});
*EDITED*
I changed the tpl file that had the id of newmessage to match the $('form.newMessage').submit(function(e) { in the js file. change was from id="newmessage" to id="newMessage" as well....