Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-01-2012, 06:56 AM   PM User | #16
XCalibre
Regular Coder

 
Join Date: Feb 2012
Posts: 121
Thanks: 19
Thanked 3 Times in 3 Posts
XCalibre has a little shameless behaviour in the past
Okay...I only changed the js file that you corrected. It's not doing anything at all. When I press enter it goes to a second line, but doesn't refresh and doesn't post. I used the same code that I just posted in the previous thread; other than u're new code that you sent. I have no idea what's wrong

Checked in Chrome...Firefox...IE.... All same thing...

Last edited by XCalibre; 03-01-2012 at 07:27 AM..
XCalibre is offline   Reply With Quote
Old 03-01-2012, 09:34 PM   PM User | #17
XCalibre
Regular Coder

 
Join Date: Feb 2012
Posts: 121
Thanks: 19
Thanked 3 Times in 3 Posts
XCalibre has a little shameless behaviour in the past
Okay...I went back to the original code that I first posted. It works, but still can't get it to enter. It only works on hitting the SEND button.

I will try to start from scratch with original code. I really appreciate all the suggestions and help you guys have given. Hopefully I can get this figured out. Anymore help would be great. Thank you all.
XCalibre is offline   Reply With Quote
Old 03-02-2012, 02:15 AM   PM User | #18
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
Quote:
Originally Posted by XCalibre View Post
Okay...I went back to the original code that I first posted. It works, but still can't get it to enter. It only works on hitting the SEND button.

I will try to start from scratch with original code. I really appreciate all the suggestions and help you guys have given. Hopefully I can get this figured out. Anymore help would be great. Thank you all.
dude, I had it working and posting messages on your page.

I cant troubleshoot it, if you keep reverting and changing the code.
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 03-02-2012, 10:30 AM   PM User | #19
XCalibre
Regular Coder

 
Join Date: Feb 2012
Posts: 121
Thanks: 19
Thanked 3 Times in 3 Posts
XCalibre has a little shameless behaviour in the past
Quote:
Originally Posted by DanInMa View Post
dude, I had it working and posting messages on your page.

I cant troubleshoot it, if you keep reverting and changing the code.
I tried that last code that was said to be working. It wasn't working for me. I will go back and copy and paste the code again, and give it a try again. You said it was working, but not on my Chrome, so I tried it with Firefox and then with IE, and it didn't work for me. Let me try it again. It's been this way forever...driving me mad LOL....

Sorry if I've misunderstood anything u've said. Not trying to Thank you.
XCalibre is offline   Reply With Quote
Old 03-02-2012, 10:58 AM   PM User | #20
XCalibre
Regular Coder

 
Join Date: Feb 2012
Posts: 121
Thanks: 19
Thanked 3 Times in 3 Posts
XCalibre has a little shameless behaviour in the past
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....

Last edited by XCalibre; 03-02-2012 at 11:03 AM..
XCalibre is offline   Reply With Quote
Old 03-02-2012, 09:02 PM   PM User | #21
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
ok this is bugging me now. I think maybe we are a step behind each other .
If you want Id be happy to setup a time where we could work on it this weekend.
Im on eastern time
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 03-03-2012, 01:28 AM   PM User | #22
XCalibre
Regular Coder

 
Join Date: Feb 2012
Posts: 121
Thanks: 19
Thanked 3 Times in 3 Posts
XCalibre has a little shameless behaviour in the past
Quote:
Originally Posted by DanInMa View Post
ok this is bugging me now. I think maybe we are a step behind each other .
If you want Id be happy to setup a time where we could work on it this weekend.
Im on eastern time
That works for me. You can private me or just type in here. I"m available anytime. I'm in the US....CST as well.
XCalibre is offline   Reply With Quote
Old 03-11-2012, 06:24 AM   PM User | #23
XCalibre
Regular Coder

 
Join Date: Feb 2012
Posts: 121
Thanks: 19
Thanked 3 Times in 3 Posts
XCalibre has a little shameless behaviour in the past
Okay...I have the shoutbox working in all three browsers.

IE...FF...Chrome....

But in IE, the smilies windows will show page not displayed. Works fine in FF and Chrome. And the actual shoutbox works great.....it's just when you click on smilies, the popup window opens, but says page not displayed. Anyone with any ideas?

Thanks.
XCalibre is offline   Reply With Quote
Old 03-13-2012, 03:22 AM   PM User | #24
XCalibre
Regular Coder

 
Join Date: Feb 2012
Posts: 121
Thanks: 19
Thanked 3 Times in 3 Posts
XCalibre has a little shameless behaviour in the past
UPDATE:

Thanks for all the help everyone! U guys have been awesome. I have all problems fixed and alternating colors for the messages. Smilies working.. All spacing is properly placed. Again, I appreciate all the time helping me.

Blessings,

X
XCalibre is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:50 AM.


Advertisement
Log in to turn off these ads.