Click to See Complete Forum and Search --> : Post to TEXTAREA question...


paulcdb
04-30-2003, 06:35 PM
Hi,

I know this is probably simple, but it's after midnight here and not had much sleep so before i go mental, lol...

I'm trying to post a customers address from a hidden field (in a shopping cart) to a TEXTAREA field on a form via the Payment gateway, but been racking my brains to why i can't seem to post a character return.

I've tried "%0D" but didn't work, it just shows up in the TEXTAREA with the rest of the address, any ideas?

:confused:

khalidali63
04-30-2003, 06:51 PM
it should be dairly simple...

document.formName.textAreaName.value= ="any value"
if this is not working then you might need to post your code here so that some one can a take a look..

bloke
05-01-2003, 05:47 AM
have you tried vbcrlf ?

paulcdb
05-01-2003, 01:04 PM
no sorry tried that too,

even tried \n even thought it's perl, lol... looks like i'll have to stick with everything on 1 line by the looks of it then :-/

Thanks anyway,
Paul

------------
the code used at the moment:
<INPUT type=hidden name="description" value="<%=name%>&nbsp; <%=lastName%>,&nbsp;<%=address%>,&nbsp;<%=city%>,&nbsp;<%=stateCode%>,&nbsp;<%=zip%>&nbsp;<%=phone%>&nbsp;<%=email%>">

This puts all the information on one line, but i would prefer to have address, etc on a seperate line, if thats any help?

khalidali63
05-01-2003, 01:25 PM
I am nost sure what are you doing incorrect,but here is the code I know works for both NS6+ and IE6+

<script type="text/javascript">
function Process(){
var tarea = document.form1.ta;
tarea.value="Value 1\nValue 2\nValue 3"
}
</script>
</head>

<body class="body">
<form name="form1" action="" onsubmit="">
<textarea name="ta"></textarea>
<input type="Button" value="process" onclick="Process()"/>
</form>

bloke
05-02-2003, 02:44 AM
I use:

strtextcode = replace(replace(request.form("text"), vbcrlf, "<br>"), "'", "^")

when inserting the customers record into the database so when I select the record from the database and write it out into another text area, I just reverse the replace functions and all is well.

Thus:

<textarea cols="78" rows="4" name="text" class="newbody"><%=replace(replace(rscontent("contenttext"), "^", "'"), "<br>", vbcrlf)%></textarea>

Hope this helps.


bloke
blokeinthekitchen.com