haku87 Posted January 19, 2008 Share Posted January 19, 2008 var test = $("#abc").html(); alert(test); //debugging purpose $.ajax({ type: "GET", url: ".././backend_php/management_php/createQuiz.php", data: "quizname="+quizname+"&category="+category+"&timelimit="+timelimit+"&instruction="+instruction, Quote Link to comment Share on other sites More sharing options...
haku87 Posted January 19, 2008 Author Share Posted January 19, 2008 var test = $("#abc").html(); alert(test); //debugging purpose $.ajax({ type: "GET", url: ".././backend_php/management_php/createQuiz.php", data: "quizname="+test ........... more code .... i get the textarea text using javascript stored into a variable called test. when i alert the content in variable test. the newline character still inside However, when i passed the variable through GET (ie. "createQuiz.php?quizname= "+test the newline character disappear when i insert into database. Quote Link to comment Share on other sites More sharing options...
taith Posted January 19, 2008 Share Posted January 19, 2008 because the address bar itself cannot have newline characters it is stripping them out... one vital flaw with GET... if you were to send via post, you probably wouldnt have this issue... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.