Jump to content

lofaifa

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lofaifa's Achievements

Member

Member (2/5)

0

Reputation

  1. how can that error impact the server ? .. and how should i fix it ?
  2. the problem is not jumping from an input to another my main problem is changing direction of just the current line u want , the other text stays in the same direction for example where writing something in english (ltr) and i want to write some arabic (rtl) i start a new line and when i click a button javascript function create a new tag inside the whole div im writing in with different direction . the first line was ltr and in second line when u clicked the cursor change direction and u can write arabic rtl first line ltr second line rtl this is what i want this is the main div tag : <div id="question_text" class="question" contenteditable="true"></div> button to change direction : <input type="button" value="<-" onclick="change_direction()" /> the javascript function im trying to play with : function change_direction(){ var string=$('.question').html(); var long=string.length; var empty_jump=string.substr(long-4); var jump=string.substr(long-10); //to make sure if the user jumped the line before clicking the button if(jump==='<br></div>'||empty_jump==='<br>'||string===''){ var ha=string.substr(0,long-15); //when i return a new line inside div and display the html a new line means : <div><br></div> so i want it plus span to change direction $(".question").html(ha+"<span><div><br></div></span>"); //now i want the cursor to be inside <span><div></div></span> ... CODE ... } else{ } } the function is obv bad but i didnt find any alternative ! CSS : #question_text span{ direction:ltr; float:left; margin-left:15px; font-family:"Courier New", Courier, monospace; font-size:14px; } Default direction is rtl in my case !
  3. maybe i should give up trying to change direction of writing inside a div tag . three days with no result
  4. i want to set the cursor inside a span tag that is inside a div editor when its created and the user complete writing inside the span html : <input type="button" value="<-" onclick="change_direction()" /> <div id="question_text" class="question" contenteditable="true"> <span id="spon"></span> </div> javascript : function change_direction(){ var string=$('.question').html(); var empty_jump=string.substr(-4); var jump=string.substr(-10); if(jump==='<br></div>'||empty_jump==='<br>'||string===''){ $(".question").append("<span id='spon'></span>"); // want to set the cursor here !!!!! this doesnt work document.getElementById('spon').focus(); //this also $("#spon").focus(); } else{ //not changing anything } }
  5. i solved the other problem but im now in another html one .. when i insert the new span tag inside the original div tag it get the same direction and float of div (when im changing span attributes to rtl) <div id="question_text" class="question" contenteditable="true"> <span id="spon">test</span> </div> #question_text{ direction:rtl; text-align:right; } #question_text span{ direction:ltr; text-align:left; }
  6. there is a problem , i want to detect all html in my div tag when i was working with textarea tag i used this : var string=$(this).attr('value'); and its not working .. also this : var string=$(this).text(); doesnt display html just text and those : string=document.getElementById('question_text').innerHTML; string=$(this).html(); gives me back when the div is empty (or when i jump a line) : <div><br></div> (empty text) <div><br></div><div><br></div> (jumped a line whith nothing in first line) <div> tags is appearing everywhere
  7. nice man .. ill try this new stuff u said and ill let u know the result later thanks everyone for ur help !
  8. and if i want to send the data inside <div> via form .. it wont work
  9. if i did that , the whole text inside the text area will change direction .. and i dont want that (tried it) what i want is if ur writing ltr (as default) normaly , and u want to write some code , it will be ugly to switch all of the provious text to rtl , soo what i want is that the previous text remains in the same direction and when u click the button ur actual direction change not the previous one , its like i wanna open a div inside the textarea with the direction u want and i put u inside it until u finished and u click back and u get out of the tag , soo that u still can see texts in different directions as u want inside ur textarea before u submit . <textarea dir="rtl"> normal text <div dir="ltr"> text with diferrent direction </div> </textarea>
  10. i have a textarea and two buttons .. my goal is when a user clicks a button the writing direction change (to rtl) , and when he clicks the other button he go back to normal direction ltr , the problem is i cant apply html tags inside a textarea cuz everything is considered a text ! any idea on how to do it ?
  11. its related to javascript in fact . i want two button .. if you click on one the direction of writing inside the textarea changes .. and when u finished with writing in the current direction and u wanna go back to the normal direction u click and u go back <textarea dir="rtl"></textarea> is the normal and when u click a div tag with direction "ltr" or something appears to do the job . when u click the other button u get out of that tag to the normal case .
  12. textarea can send data also .. anyway im having the problem of making changes inside textarea .. i couldnt do that cuz textarea considers everything a test so if i write something like this <textarea><b>test</b></texterea> it wont work , it will display <b>test</b> soo i need something like textarea that let html tags work ! any advice ?
  13. sorry that was a mistake , i didnt mean to double post
  14. ..and its not working (i replaced <textarea> with <div> to apply some html tags inside it ) and this is my form : <form action="proc.php" method="post"> <div id="text" name="question_text" class="text" contenteditable="true"></div> </form> but when i submit some text the $_POST['question_text'] is not set !
  15. ..and its not working (i replaced <textarea> with <div> to apply some html tags inside it ) and this is my form : <form action="proc.php" method="post"> <div id="text" name="question_text" class="text" contenteditable="true"></div> </form> but when i submit some text the $_POST['question_text'] is not set !
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.