Jump to content

UltraMarkus

Members
  • Posts

    6
  • Joined

  • Last visited

UltraMarkus's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. A bit later then promised. As I use a normal .val() without the replace() extended it results in the db without any sign of /n/l or <BR>. It's just a line without enters. ajax_request("berichtPlaatsen.php?table=te_koop_aangeboden&naam="+$("#naam").val()+"&email="+$("#email").val()+"&bericht="+$("#bericht").val(),"#adToevoegen",berichtGeplaatst);
  2. Okay, well the reason why I used it in JS is because my nl2br function didn't work. Normaly when I use a page refresh and send my DB data trough nl2br it catches the whole thing. Now I use this AJAX REQUEST and it fails. Tonight when I'm at home I will check what data is stored in my DB after sending it and not using the JS replace function.
  3. ------------------------------------------ Send form ------------------------------------------ function adSubmit() { ajax_request("berichtPlaatsen.php?table=te_koop_aangeboden&naam="+$("#naam").val()+"&email="+$("#email").val()+"&bericht="+$("#bericht").val().replace(/\n/g,"<br>"),"#adToevoegen",berichtGeplaatst); } <form> textarea id="bericht" name="bericht" style="width:99%; height:200px">bericht</textarea> <input id="submitButton" type="button" onclick="adSubmit()" value="Plaatsen" > </form> ------------------------------------------- When displaying ------------------------------------------- $bericht = $res[$i]["bericht"]; $bericht = str_replace("<","<",$bericht); $bericht = str_replace(">",">",$bericht); echo $bericht; ------------------------------------------- DB STORAGE AFTER PUTTING line 1 line 2 line 3 -------------------------------------------- line 1<br>line 2<br>line 3 Perhaps my js replace funtion aint correct. If you need more just ask
  4. $("#bericht").val().replace(/\n/g,"<br>") this is send to my ajax request. And the above convertion is created. If i leave the /n/l then i use nl2br in php and nothing happens either
  5. It was like all conversions were done to : "<" = "<" and ">" = ">" Just converted them $message = str_replace("<","<",$message); $message = str_replace(">",">",$message); Hope it helps someone. UltraMarkus
  6. Hi, First post on this form for me now. Love to see how many posts are made on this site. Well after searching a few hours my problem remains and started to look for some help. Here is what I do: 1. Read a textarea with val() and send it trough ajax. 2. In my php file I send the data to a DB. 3. I read the db and uses nl2br to make this all seem worth it. But now there is a funny thing happening, i can see no next lines(breaks). So what did I do, I used to replace all /n/l things to <BR /> with some repeace function. But now when i echo my little tekst there is just a simple <BR /> beeing displayed. Anyone knows someting about this problem? UltraMarkus.
×
×
  • 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.