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

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

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 11-10-06, 11:45   # 1
Elad-A
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 1,987

Elad-A לא מחובר  

שים את זה ב HEAD:

PHP קוד:

<script type="text/javascript"
function 
addtoForm(openTagcloseTagtextAreaId){ /// Add tags code to textarea 
    
var txtAr document.getElementById(""+textAreaId), oRange 
    txtAr
.focus() 
    if (
document.selection && document.selection.createRange){ 
        
oRange=document.selection.createRange(); /// Create Range object form the selected Text 
        
if (oRange.parentElement()==txtAr){ /// Check if the parent of the Range object is our textarea 
         
oRange.textopenTag+oRange.text+closeTag /// add the tags before and after the selected text 
        

    }else if(
navigator.appName=="Netscape"){ 
        var 
txtLength parseInt(txtAr.textLength// fint the length of the selected text 
        
var selStart=txtAr.selectionStart /// find the start position 
        
var selEnd=txtAr.selectionEnd /// find the end position 
        
if (selEnd==|| selEnd==1){ 
            
selEnd=txtLength 
        

        var 
sect1 = (txtAr.value).substring(0,selStart/// text before the selected text 
        
var sect2 = (txtAr.value).substring(selStart,selEnd// the selected text 
        
var sect3 = (txtAr.value).substring(selEnd,txtLength/// text after the selected text 
        
txtAr.value sect1+openTag+sect2+closeTag+sect3 /// add the tags before and after the selected text 
        
txtAr.focus() 
    }else{ 
        return (
alert("your browser is not supported by us\ only Mozilla(NS6 & higher) AND IE\n thanks"),false
    } 


</script> 
וכדי להשתמש תעשה ככה:

PHP קוד:

<form action="<?=$PHP_SELF?>" method="post"> 
<input type="button" value="מודגש" onClick="addtoForm('[b]', '[/b]', 'elad')" /><br />
<textarea rows="5" name="text" id="elad" cols="36"></textarea><br>  
<input type="submit" value="Send" name="submit" >  
</form>
אני מקווה שזה מה שהתכוונת אליו..
  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. הזמן כעת הוא 17:02.

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