Jump to content

multiline text area problem

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
hi codecall people,
i have a serious problem with a php & JS, i have data stored in mysql databse as TEXTwhich contains new lines

i write text here

this is line 2

i get an error

anyways when i fetch the data above from the database and try to load it back into a textarea using JS, i get an error because the text is written with multi-lines like this

$('text_area_id').set("text",'<?php echo $result; ?>');

the error i get is "expected end of a string..."

does anyone know how to solve that?
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
have you tried
echo "$('text_area_id').set(\"text\",'".$result."?>');";


#3
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
yes, in the source code it appears some thing like:
$('text_area_id').set(\"text\",'i write text here
this is line 2
i get an error');
which gives the same error
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#4
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
ah, its javascript that doesn't allow the line breakages.
I guess you'd better load it by ajax instead then.

#5
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
offff!
so to get it done i have 2 choices:
1. print the HTML with php
2. ajax
right?
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#6
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
yes, I believe so...