hi there..

can i retrieve the break tag from querystring? i have a textarea which i store in a querystring. the textarea will not show the break tag if i have break tag among the text i typed.

let me explain in greater details. i have a dropdownlist whereby onclick it will store the values from other html inputs' values (textarea, dropdownlist) into the querystring, and the html inputs' values should remain. the problem is that if i have a chunk of words in a textarea where there are paragraph breaks and when the dropdownlist onclick triggers, there are no paragraph breaks, the words are all joined together.

here are my codes:

<textarea name="txt" id="txt" rows="5" cols="100" class="text" mandatory='true' display='txt' pattern='ALPHA_NUMERIC_PLUS'><%=request.QueryString("txt")%></textarea>

function check(){
	document.form.action = "page.asp?txt="+document.form.txt.value;
	document.form.submit();
}

Why use the querystring? Can't you use POST rather than GET? Also, you aren't supposed to enter HTML tags into a textarea... it should automatically "break" text according to the browser window size.

Agreed with tgreer. Better to use post in your form and retrive the data from texarea using request.form("txt"). Here is what I would normally do:

mytxt = request.form("txt")
' use one of the following depend how you want to display your data
mytxt = replace(mytxt, "<br>", Chr(13)) ' convert html tag into new line
mytxt = replace(mytxt, Chr(13), "<br>") ' convert new line/break into html tag

You may use \n instead of Chr(13)

.

when u output the php row write this

<?php
$query = "your select";
$result = mysql_query($query);
while($row = mysql_fetch_asssoc)
{
   nl2br($row['yourrow']);
}
?>

this is a php function use this hope it helps u

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.