הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 22-07-08, 16:17   # 1
Ron | CSite.co.il
חבר על
 
מיני פרופיל
תאריך הצטרפות: Jun 2007
גיל: 33
הודעות: 980

Ron | CSite.co.il לא מחובר  

ajax|ירידת שורה בתיבת textarea

שלום לכולם,
יש לי בעיה ממש מוזרה עם textarea.
אני מנסה לעדכן נתונים במסד עם תיבת טקסט ללא רענון.
הכל מתעדכן טוב רק שכל תווי הירידת שורה פשוט נעלמים (תגי ה \n).

אגב בהתחלה חשבתי שהבעיה היא פה:
HTML קוד:
			// evaluate javascript
			scriptTag='(<script.*?>)((\n|\r|.)*?)(<\/script>)';
			if (scripts=resultsuser.match(scriptTag)) 
			{
				// remove slashes
			 	scripts[2]=scripts[2].replace(/\\/g,"");
			 	//run scripts
			 	eval(scripts[2]);
			}
אבל הורדתי את הקטע הזה וזה עדיין נשאר אותו הדבר.

קוד html:
HTML קוד:
<form name='Login'>
	<textarea cols="91" rows="15" id="ContentMessage"><tag:Content messages admins.Content /></textarea>
	<br />
	<input type='button' class="button" value="עדכן"
	onclick='AjaxUpdateDiv("MessageAdmins","ajax/ajax_index.php","?ContentMessage="+									   document.getElementById("ContentMessage").value);' />	
	<input type="button" class="button" value="בטל" 
	onclick='AjaxUpdateDiv("MessageAdmins","ajax/ajax_index.php","?ajax=cancel")' />	
</form>
קוד js :
HTML קוד:
//Browser Support Code
function AjaxUpdateDiv(DivUpdate,PageOpen,get)
{
	var ajaxRequest;  // The variable that makes Ajax possible!
	try
	{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		// Internet Explorer Browsers
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
			var ajaxDisplay = document.getElementById(DivUpdate);
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
			
			resultsuser = ajaxRequest.responseText;
			// evaluate javascript
			scriptTag='(<script.*?>)((\n|\r|.)*?)(<\/script>)';
			if (scripts=resultsuser.match(scriptTag)) 
			{
				// remove slashes
			 	scripts[2]=scripts[2].replace(/\\/g,"");
			 	//run scripts
			 	eval(scripts[2]);
			}		
		}
	}
	
	ajaxRequest.open("GET",PageOpen + get, true);
	ajaxRequest.send(null); 
}
יום טוב.
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
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 מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 01:08.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ